]> git.baikalelectronics.ru Git - kernel.git/commit
lib/mpi: mpi_read_raw_from_sgl(): replace len argument by nbytes
authorNicolai Stange <nicstange@gmail.com>
Tue, 22 Mar 2016 12:12:43 +0000 (13:12 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 5 Apr 2016 12:35:49 +0000 (20:35 +0800)
commitfe3594e22f12f00bfe9aca6a783694e5a3222aac
tree394b7d92b978c137b10c3496cfb4af0797d3e14f
parent3f5001dea05ff1eae9d81ffc192e7927943aefbc
lib/mpi: mpi_read_raw_from_sgl(): replace len argument by nbytes

Currently, the nbytes local variable is calculated from the len argument
as follows:

  ... mpi_read_raw_from_sgl(..., unsigned int len)
  {
    unsigned nbytes;
    ...
    if (!ents)
      nbytes = 0;
    else
      nbytes = len - lzeros;
    ...
  }

Given that nbytes is derived from len in a trivial way and that the len
argument is shadowed by a local len variable in several loops, this is just
confusing.

Rename the len argument to nbytes and get rid of the nbytes local variable.
Do the nbytes calculation in place.

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