crypto: rockchip - drop redundant crypto_skcipher_ivsize() calls

The function already initialized the ivsize variable
at the point of declaration, let's use it instead of
calling crypto_skcipher_ivsize() extra couple times.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 57d67c6e82 ("crypto: rockchip - rework by using crypto_engine")
Signed-off-by: Karina Yankevich <k.yankevich@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
pull/1354/merge
Karina Yankevich 2025-11-05 17:52:04 +03:00 committed by Herbert Xu
parent d633730bb3
commit d52e9b8843
1 changed files with 1 additions and 2 deletions

View File

@ -321,8 +321,7 @@ static int rk_cipher_run(struct crypto_engine *engine, void *async_req)
algt->stat_req++; algt->stat_req++;
rkc->nreq++; rkc->nreq++;
ivsize = crypto_skcipher_ivsize(tfm); if (areq->iv && ivsize > 0) {
if (areq->iv && crypto_skcipher_ivsize(tfm) > 0) {
if (rctx->mode & RK_CRYPTO_DEC) { if (rctx->mode & RK_CRYPTO_DEC) {
offset = areq->cryptlen - ivsize; offset = areq->cryptlen - ivsize;
scatterwalk_map_and_copy(rctx->backup_iv, areq->src, scatterwalk_map_and_copy(rctx->backup_iv, areq->src,