Skip to contentSkip to conversation

crypto: riscv - replace min_t with min in riscv64_aes_ctr_crypt

PATCH In review Thorsten Blum 2 participants 2 messages May 14 – May 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: riscv - replace min_t with min in riscv64_aes_ctr_crypt

Use the simpler min() macro since the values are unsigned and compatible.

---
 arch/riscv/crypto/aes-riscv64-glue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/crypto/aes-riscv64-glue.c +2 -2
index 8bbf7f348c23..bbd920c9e29d 100644
@@ -19,6 +19,7 @@
 #include <crypto/scatterwalk.h>
 #include <crypto/xts.h>
 #include <linux/linkage.h>
+#include <linux/minmax.h>
 #include <linux/module.h>
 
 asmlinkage void aes_ecb_encrypt_zvkned(const struct crypto_aes_ctx *key,
@@ -266,8 +267,7 @@ static int riscv64_aes_ctr_crypt(struct skcipher_request *req)
 			 * operation into two at the point where the overflow
 			 * will occur.  After the first part, add the carry bit.
 			 */
-			p1_nbytes = min_t(unsigned int, nbytes,
-					  (nblocks - ctr32) * AES_BLOCK_SIZE);
+			p1_nbytes = min(nbytes, (nblocks - ctr32) * AES_BLOCK_SIZE);
 			aes_ctr32_crypt_zvkned_zvkb(ctx, walk.src.virt.addr,
 						    walk.dst.virt.addr,
 						    p1_nbytes, req->iv);
maintainer
#1 lore raw
Quoted 7 lines · Thorsten Blum

Use the simpler min() macro since the values are unsigned and compatible.

---
 arch/riscv/crypto/aes-riscv64-glue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt