diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-07-04 17:25:05 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2024-07-13 01:50:28 +0200 |
commit | fe69b772e35e181ff0576ab4a610515ffe7a3325 (patch) | |
tree | 1527522b1172209e50093f227a6ba706a38a08ca /lib | |
parent | crypto: testmgr - generate power-of-2 lengths more often (diff) | |
download | linux-fe69b772e35e181ff0576ab4a610515ffe7a3325.tar.xz linux-fe69b772e35e181ff0576ab4a610515ffe7a3325.zip |
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 <dan.carpenter@linaro.org>
Reviewed-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crypto/mpi/mpi-bit.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/crypto/mpi/mpi-bit.c b/lib/crypto/mpi/mpi-bit.c index 070ba784c9f1..e08fc202ea5c 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); |