forked from luck/tmp_suning_uos_patched
lib/mpi: mpi_write_sgl(): purge redundant pointer arithmetic
Within the copying loop in mpi_write_sgl(), we have if (lzeros) { ... p -= lzeros; y = lzeros; } p = p - (sizeof(alimb) - y); If lzeros == 0, then y == 0, too. Thus, lzeros gets subtracted and added back again to p. Purge this redundancy. Signed-off-by: Nicolai Stange <nicstange@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
654842ef53
commit
ea122be0b8
|
@ -407,12 +407,11 @@ int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned *nbytes,
|
|||
mpi_limb_t *limb2 = (void *)p - sizeof(alimb)
|
||||
+ lzeros;
|
||||
*limb1 = *limb2;
|
||||
p -= lzeros;
|
||||
y = lzeros;
|
||||
lzeros = 0;
|
||||
}
|
||||
|
||||
p = p - (sizeof(alimb) - y);
|
||||
p = p - sizeof(alimb);
|
||||
|
||||
for (x = 0; x < sizeof(alimb) - y; x++) {
|
||||
if (!buf_len) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user