From: Axel Lin Date: Wed, 30 Sep 2015 12:35:15 +0000 (+0100) Subject: nvmem: core: Handle shift bits in-place if cell->nbits is non-zero X-Git-Tag: v4.9.8~3423^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbf854ab36870b931aeba4edd954015b7c3005a2;p=platform%2Fkernel%2Flinux-rpi3.git nvmem: core: Handle shift bits in-place if cell->nbits is non-zero 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 Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index f4af8e5..676607c 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -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;