[PATCH] crypto: simd - Simplify request size calculation in simd_aead_init

Thorsten Blum posted 1 patch 1 month, 2 weeks ago
crypto/simd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] crypto: simd - Simplify request size calculation in simd_aead_init
Posted by Thorsten Blum 1 month, 2 weeks ago
Fold both assignments into a single max() call to simplify the code.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 crypto/simd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/simd.c b/crypto/simd.c
index b07721d1f3f6..2a7549e280ca 100644
--- a/crypto/simd.c
+++ b/crypto/simd.c
@@ -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);
-- 
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4
Re: [PATCH] crypto: simd - Simplify request size calculation in simd_aead_init
Posted by Herbert Xu 2 weeks, 2 days ago
On Mon, Dec 22, 2025 at 11:42:53AM +0100, Thorsten Blum wrote:
> Fold both assignments into a single max() call to simplify the code.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  crypto/simd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt