]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: simd - Simplify request size calculation in simd_aead_init
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 22 Dec 2025 10:42:53 +0000 (11:42 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 23 Jan 2026 05:48:43 +0000 (13:48 +0800)
Fold both assignments into a single max() call to simplify the code.

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

index b07721d1f3f6ea37ff7f4d9dc9fce0688ca59d57..2a7549e280ca500488249c9c3faef9a1d74f4ce8 100644 (file)
@@ -352,8 +352,8 @@ static int simd_aead_init(struct crypto_aead *tfm)
 
        ctx->cryptd_tfm = cryptd_tfm;
 
-       reqsize = crypto_aead_reqsize(cryptd_aead_child(cryptd_tfm));
-       reqsize = max(reqsize, crypto_aead_reqsize(&cryptd_tfm->base));
+       reqsize = max(crypto_aead_reqsize(cryptd_aead_child(cryptd_tfm)),
+                     crypto_aead_reqsize(&cryptd_tfm->base));
        reqsize += sizeof(struct aead_request);
 
        crypto_aead_set_reqsize(tfm, reqsize);