From: Dan Carpenter Date: Thu, 4 Jul 2024 15:25:05 +0000 (-0500) Subject: crypto: lib/mpi - delete unnecessary condition X-Git-Tag: v6.11-rc1~119^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe69b772e35e181ff0576ab4a610515ffe7a3325;p=thirdparty%2Fkernel%2Flinux.git crypto: lib/mpi - delete unnecessary condition We checked that "nlimbs" is non-zero in the outside if statement so delete the duplicate check here. Signed-off-by: Dan Carpenter Reviewed-by: Tianjia Zhang Signed-off-by: Herbert Xu --- diff --git a/lib/crypto/mpi/mpi-bit.c b/lib/crypto/mpi/mpi-bit.c index 070ba784c9f15..e08fc202ea5cf 100644 --- a/lib/crypto/mpi/mpi-bit.c +++ b/lib/crypto/mpi/mpi-bit.c @@ -212,12 +212,10 @@ void mpi_rshift(MPI x, MPI a, unsigned int n) return; } - if (nlimbs) { - for (i = 0; i < x->nlimbs - nlimbs; i++) - x->d[i] = x->d[i+nlimbs]; - x->d[i] = 0; - x->nlimbs -= nlimbs; - } + for (i = 0; i < x->nlimbs - nlimbs; i++) + x->d[i] = x->d[i+nlimbs]; + x->d[i] = 0; + x->nlimbs -= nlimbs; if (x->nlimbs && nbits) mpihelp_rshift(x->d, x->d, x->nlimbs, nbits);