Skip to contentSkip to conversation

crypto: simd - Simplify request size calculation in simd_aead_init

PATCH In review Thorsten Blum 2 participants 2 messages Dec 22, 2025 – Jan 23 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: simd - Simplify request size calculation in simd_aead_init

Fold both assignments into a single max() call to simplify the code.

---
 crypto/simd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/simd.c +2 -2
index b07721d1f3f6..2a7549e280ca 100644
@@ -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);
Signature · 2 lines
Thorsten Blum <[email protected]>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4
maintainer
#1 lore raw
Quoted 6 lines · Thorsten Blum

Fold both assignments into a single max() call to simplify the code.

---
 crypto/simd.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