Skip to content

Commit

Permalink
crypto: artpec6 - Use helper to set reqsize
Browse files Browse the repository at this point in the history
The value of reqsize must only be changed through the helper.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Ovidiu Panait authored and Herbert Xu committed Dec 29, 2023
1 parent 3088f5e commit 4ef388f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/crypto/axis/artpec6_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,8 @@ static int artpec6_crypto_aes_ecb_init(struct crypto_skcipher *tfm)
{
struct artpec6_cryptotfm_context *ctx = crypto_skcipher_ctx(tfm);

tfm->reqsize = sizeof(struct artpec6_crypto_request_context);
crypto_skcipher_set_reqsize(tfm,
sizeof(struct artpec6_crypto_request_context));
ctx->crypto_type = ARTPEC6_CRYPTO_CIPHER_AES_ECB;

return 0;
Expand All @@ -1551,7 +1552,8 @@ static int artpec6_crypto_aes_ctr_init(struct crypto_skcipher *tfm)
if (IS_ERR(ctx->fallback))
return PTR_ERR(ctx->fallback);

tfm->reqsize = sizeof(struct artpec6_crypto_request_context);
crypto_skcipher_set_reqsize(tfm,
sizeof(struct artpec6_crypto_request_context));
ctx->crypto_type = ARTPEC6_CRYPTO_CIPHER_AES_CTR;

return 0;
Expand All @@ -1561,7 +1563,8 @@ static int artpec6_crypto_aes_cbc_init(struct crypto_skcipher *tfm)
{
struct artpec6_cryptotfm_context *ctx = crypto_skcipher_ctx(tfm);

tfm->reqsize = sizeof(struct artpec6_crypto_request_context);
crypto_skcipher_set_reqsize(tfm,
sizeof(struct artpec6_crypto_request_context));
ctx->crypto_type = ARTPEC6_CRYPTO_CIPHER_AES_CBC;

return 0;
Expand All @@ -1571,7 +1574,8 @@ static int artpec6_crypto_aes_xts_init(struct crypto_skcipher *tfm)
{
struct artpec6_cryptotfm_context *ctx = crypto_skcipher_ctx(tfm);

tfm->reqsize = sizeof(struct artpec6_crypto_request_context);
crypto_skcipher_set_reqsize(tfm,
sizeof(struct artpec6_crypto_request_context));
ctx->crypto_type = ARTPEC6_CRYPTO_CIPHER_AES_XTS;

return 0;
Expand Down

0 comments on commit 4ef388f

Please sign in to comment.