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

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

 



Hello,

On Fri, Mar 24, 2023 at 09:53:29AM +0000, Sudeep Holla wrote:
> 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.

My motivation isn't big enough to even read that. If the usual kernel
workflow doesn't work for ACPICA, let's drop the patch.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[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