Skip to content

Commit fe69b77

Browse files
Dan Carpenterherbertx
authored andcommitted
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 <[email protected]> Reviewed-by: Tianjia Zhang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 101e99c commit fe69b77

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/crypto/mpi/mpi-bit.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,10 @@ void mpi_rshift(MPI x, MPI a, unsigned int n)
212212
return;
213213
}
214214

215-
if (nlimbs) {
216-
for (i = 0; i < x->nlimbs - nlimbs; i++)
217-
x->d[i] = x->d[i+nlimbs];
218-
x->d[i] = 0;
219-
x->nlimbs -= nlimbs;
220-
}
215+
for (i = 0; i < x->nlimbs - nlimbs; i++)
216+
x->d[i] = x->d[i+nlimbs];
217+
x->d[i] = 0;
218+
x->nlimbs -= nlimbs;
221219

222220
if (x->nlimbs && nbits)
223221
mpihelp_rshift(x->d, x->d, x->nlimbs, nbits);

0 commit comments

Comments
 (0)