]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: riscv/aes - replace min_t with min in riscv64_aes_ctr_crypt
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 14 May 2026 16:55:10 +0000 (18:55 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 May 2026 12:25:29 +0000 (20:25 +0800)
Use the simpler min() macro since the values are unsigned and
compatible.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/riscv/crypto/aes-riscv64-glue.c

index 8bbf7f348c233829bafe0ef6f21f67fcf27d59a9..bbd920c9e29d1ad624e5bfcc3b1ad4c4162abb1f 100644 (file)
@@ -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);