Re: [PATCH 2/10] crypto: aead - Count error stats differently

Herbert Xu
2023-02-16T05:58:11Z

On Wed, Feb 15, 2023 at 09:35:21PM -0800, Eric Biggers wrote:
> On Wed, Feb 15, 2023 at 05:25:09PM +0800, Herbert Xu wrote:
> > int crypto_aead_encrypt(struct aead_request *req)
> > {
> > struct crypto_aead *aead = crypto_aead_reqtfm(req);
> > - struct crypto_alg *alg = aead->base.__crt_alg;
> > + struct aead_alg *alg = crypto_aead_alg(aead);
> > unsigned int cryptlen = req->cryptlen;
>
> The cryptlen local variable is no longer needed. Just use req->cryptlen below.

Thanks, I'll remove it.

> This could just check whether istat is NULL:

Yes but that would introduce an unnecessary branch when STATS
are enabled. I agree that it makes no difference if you don't
enable STATS though.

Cheers,
--
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