Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 57d67c6e8219 ("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>

authored by

Karina Yankevich and committed by
Herbert Xu
d52e9b88 d633730b

+1 -2
+1 -2
drivers/crypto/rockchip/rk3288_crypto_skcipher.c
··· 321 321 algt->stat_req++; 322 322 rkc->nreq++; 323 323 324 - ivsize = crypto_skcipher_ivsize(tfm); 325 - if (areq->iv && crypto_skcipher_ivsize(tfm) > 0) { 324 + if (areq->iv && ivsize > 0) { 326 325 if (rctx->mode & RK_CRYPTO_DEC) { 327 326 offset = areq->cryptlen - ivsize; 328 327 scatterwalk_map_and_copy(rctx->backup_iv, areq->src,