[lvc-project] [PATCH] gpiolib: acpi: use BIT_ULL() for u64 mask in address space handler
Mika Westerberg
mika.westerberg at linux.intel.com
Tue Jan 27 11:07:59 MSK 2026
On Mon, Jan 26, 2026 at 06:59:14AM +0300, Denis Sergeev wrote:
> The BIT() macro uses unsigned long, which is 32 bits on 32-bit
> architectures. When iterating over GPIO pins with index >= 32,
> the expression (*value & BIT(i)) causes undefined behavior due
> to shifting by a value >= type width.
>
> Since 'value' is a pointer to u64, use BIT_ULL() to ensure correct
> 64-bit mask on all architectures.
>
> Found by Linux Verification Center (linuxtesting.org) with Svace.
>
> Fixes: 2c4d00cb8fc5 ("gpiolib: acpi: Use BIT() macro to increase readability")
> Signed-off-by: Denis Sergeev <denserg.edu at gmail.com>
Reviewed-by: Mika Westerberg <westeri at kernel.org>
More information about the lvc-project
mailing list