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-Url: https://git.stricted.de/?a=commitdiff_plain;h=cbf854ab36870b931aeba4edd954015b7c3005a2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 f4af8e5fcd94..676607cb01bb 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;