]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwrng: core - use min3() instead of nested min_t()
authorDavid Laight <david.laight.linux@gmail.com>
Wed, 19 Nov 2025 22:41:10 +0000 (22:41 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 24 Nov 2025 09:44:14 +0000 (17:44 +0800)
commit0f8ead58b6dce9520fc3f9ff7f943bb0627a7a19
tree3514465756fa9e67f505a7b4c204f2537868f7b4
parent6c5d5b6dc5eb966e86a92e6587ccca1ec1e392e1
hwrng: core - use min3() instead of nested min_t()

min_t(u16, a, b) is likely to discard significant bits.
Replace:
min_t(u16, min_t(u16, default_quality, 1024), rng->quality ?: 1024);
with:
min3(default_quality, 1024, rng->quality ?: 1024);

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c