Skip to content

Commit

Permalink
nvmem: core: Handle shift bits in-place if cell->nbits is non-zero
Browse files Browse the repository at this point in the history
It's pointless to test (cell->bit_offset || cell->bit_offset).
nvmem_shift_read_buffer_in_place() should be called when
(cell->bit_offset || cell->nbits).

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Axel Lin authored and Greg Kroah-Hartman committed Oct 4, 2015
1 parent 7c80688 commit cbf854a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvmem/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem,
return rc;

/* shift bits in-place */
if (cell->bit_offset || cell->bit_offset)
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);

*len = cell->bytes;
Expand Down

0 comments on commit cbf854a

Please sign in to comment.