]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpiolib: acpi: use BIT_ULL() for u64 mask in address space handler
authorDenis Sergeev <denserg.edu@gmail.com>
Mon, 26 Jan 2026 03:59:14 +0000 (06:59 +0300)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Tue, 27 Jan 2026 19:27:59 +0000 (20:27 +0100)
commitc0ae43d303e45764918fa8c1dc13d6a5db59c479
tree78c7cd08d899763bbd7a7c542564b04c954c6cf3
parent96313fcc1f062ba239f4832c9eff685da6c51c99
gpiolib: acpi: use BIT_ULL() for u64 mask in address space handler

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@gmail.com>
Reviewed-by: Mika Westerberg <westeri@kernel.org>
Link: https://lore.kernel.org/r/20260126035914.16586-1-denserg.edu@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpiolib-acpi-core.c