]> Gentwo Git Trees - linux/.git/commit
nodemask: use min() instead of min_t()
authorDavid Laight <david.laight.linux@gmail.com>
Wed, 19 Nov 2025 22:41:28 +0000 (22:41 +0000)
committerYury Norov (NVIDIA) <yury.norov@gmail.com>
Thu, 20 Nov 2025 15:02:22 +0000 (10:02 -0500)
commitd1cadd4bfc2802c6f73b1739dbceef7513afc591
treef771516b53569d31d0350bae68c79e4d9491fbf6
parent6f15c3d715f1bf1025f88890eec7f3da210097a9
nodemask: use min() instead of min_t()

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

In this case the 'unsigned long' value is small enough that the result
is ok.

Detected by an extra check added to min_t().

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
include/linux/nodemask.h