]> 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)
commit5de27b0ef131d4e0143a9bbb83142bcb26ee908c
tree48df6ac9ff7c440bc8c26646dbc225e363ed6adf
parent29884e648481da41c4c58851bbf019d825870bcf
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