Re: [PATCH] ACPICA: Make check to install handler more obviously correct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 24, 2023 at 08:58:54AM +0100, Uwe Kleine-König wrote:
> The loop
> 
> 	for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) {
> 		if (handler_type & (i + 1)) {
> 			...
> 		}
> 	}
> 
> looks strange. Only with knowing that ACPI_NUM_NOTIFY_TYPES == 2 you can
> see that the two least significant bits are checked. Still replace
> 
> 	i + 1
> 
> by
> 
> 	1 << i
> 
> which shouldn't make a relevant difference to compiler and compiled
> code, but is easier to understand for a human code reader.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

You need to submit this to ACPICA project first.
Documentation/driver-api/acpi/linuxized-acpica.rst explains the process.
Refer [1] for details for similar suggestion by Rafael.

-- 
Regards,
Sudeep

[1] https://lore.kernel.org/all/CAJZ5v0gPUBFzuFiRWW8KHAwB1Agy+Le=CWuRD0RTr4MkNeEmQw@xxxxxxxxxxxxxx




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux