]> git.ipfire.org Git - thirdparty/linux.git/commit
gpiolib: acpi: use min() instead of min_t()
authorDavid Laight <david.laight.linux@gmail.com>
Wed, 19 Nov 2025 22:41:14 +0000 (22:41 +0000)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 20 Nov 2025 08:08:27 +0000 (09:08 +0100)
commitb2a186cced1199bb2777e229dc37a04d33507c6d
tree3a1168cfb05c9f41f8913f7641ef5b5da4972fc5
parent3a8660878839faadb4f1a6dd72c3179c1df56787
gpiolib: acpi: use min() instead of min_t()

min_t(u16, a, b) casts an 'unsigned long' to 'u16'.
Use min(a, b) instead as it promotes the both values to int
and so cannot discard significant bits.

In this case the values should be ok.

Detected by an extra check added to min_t().

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpiolib-acpi-core.c