]> git.baikalelectronics.ru Git - kernel.git/commit
lib/mpi: refactor mpi_read_from_buffer() in terms of mpi_read_raw_data()
authorNicolai Stange <nicstange@gmail.com>
Thu, 26 May 2016 21:19:55 +0000 (23:19 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 31 May 2016 08:42:01 +0000 (16:42 +0800)
commit668637b7df2be1367e6c8b8b745b34396297f0b3
tree48df6ac9ff7c440bc8c26646dbc225e363ed6adf
parent0c0e03281afe5e785c8aae471122e08383ea4edf
lib/mpi: refactor mpi_read_from_buffer() in terms of mpi_read_raw_data()

mpi_read_from_buffer() and mpi_read_raw_data() do basically the same thing
except that the former extracts the number of payload bits from the first
two bytes of the input buffer.

Besides that, the data copying logic is exactly the same.

Replace the open coded buffer to MPI instance conversion by a call to
mpi_read_raw_data().

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