]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: ccp - use min() instead of min_t()
authorDavid Laight <david.laight.linux@gmail.com>
Wed, 19 Nov 2025 22:41:12 +0000 (22:41 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 24 Nov 2025 09:44:14 +0000 (17:44 +0800)
commit14ca8ce1fcbbd4448c302e144052cfc2fe288232
treeefdfc69bc7a9d8ce487867226b9e69ca2fe8fb95
parent0f8ead58b6dce9520fc3f9ff7f943bb0627a7a19
crypto: ccp - 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: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-dev.c