summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-18 09:29:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-18 09:29:27 +0200
commit22d4f9beaf32a7cda9edeafdf5e99bec3de32c51 (patch)
tree37fd192452ba853e740d4b8c3fa0f171dc2b8d33 /drivers/nvmem
parentnvmem: imx-ocotp: add support for post processing (diff)
parentLinux 5.15-rc6 (diff)
downloadlinux-22d4f9beaf32a7cda9edeafdf5e99bec3de32c51.tar.xz
linux-22d4f9beaf32a7cda9edeafdf5e99bec3de32c51.zip
Merge 5.15-rc6 into char-misc-next
We need the char/misc fixes in here for merging and testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index d7013c9b0fae..e765d3d0542e 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -1424,7 +1424,8 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void
*p-- = 0;
/* clear msb bits if any leftover in the last byte */
- *p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0);
+ if (cell->nbits % BITS_PER_BYTE)
+ *p &= GENMASK((cell->nbits % BITS_PER_BYTE) - 1, 0);
}
static int __nvmem_cell_read(struct nvmem_device *nvmem,