Re: [PATCH v2] ACPI: NFIT: Optimize nfit_mem_cmp() for efficiency

2023-10-18 Thread Kuan-Wei Chiu
On Wed, Oct 18, 2023 at 01:17:31PM +0200, Rafael J. Wysocki wrote: > On Fri, Oct 13, 2023 at 2:22 PM Kuan-Wei Chiu wrote: > > > > The original code used conditional branching in the nfit_mem_cmp > > function to compare two values and return -1, 1, or 0 based on the > > result. However, the

Re: [PATCH v2] ACPI: NFIT: Optimize nfit_mem_cmp() for efficiency

2023-10-18 Thread Rafael J. Wysocki
On Fri, Oct 13, 2023 at 2:22 PM Kuan-Wei Chiu wrote: > > The original code used conditional branching in the nfit_mem_cmp > function to compare two values and return -1, 1, or 0 based on the > result. However, the list_sort comparison function only needs results > <0, >0, or =0. This patch

[PATCH v2] ACPI: NFIT: Optimize nfit_mem_cmp() for efficiency

2023-10-13 Thread Kuan-Wei Chiu
The original code used conditional branching in the nfit_mem_cmp function to compare two values and return -1, 1, or 0 based on the result. However, the list_sort comparison function only needs results <0, >0, or =0. This patch optimizes the code to make the comparison branchless, improving