lib/mpi: mpi_read_raw_data(): purge redundant clearing of nbits
authorNicolai Stange <nicstange@gmail.com>
Thu, 26 May 2016 11:05:31 +0000 (13:05 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 31 May 2016 08:41:58 +0000 (16:41 +0800)
In mpi_read_raw_data(), unsigned nbits is calculated as follows:

 nbits = nbytes * 8;

and redundantly cleared later on if nbytes == 0:

  if (nbytes > 0)
    ...
  else
    nbits = 0;

Purge this redundant clearing for the sake of clarity.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/mpi/mpicoder.c

index c7420335a5bb766dba7abdceb80437f26abda8e4..37d6a4edb33cbec0ad59cac65c36964fe89fde64 100644 (file)
@@ -51,8 +51,6 @@ MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)
        }
        if (nbytes > 0)
                nbits -= count_leading_zeros(buffer[0]);
-       else
-               nbits = 0;
 
        nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB);
        val = mpi_alloc(nlimbs);