Skip to content

Commit 8eab965

Browse files
svenpeter42marcan
authored andcommitted
nvmem: round up to word_size
Signed-off-by: Sven Peter <[email protected]>
1 parent 580faf9 commit 8eab965

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/nvmem/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,
481481
cell->np = info->np;
482482

483483
if (cell->nbits)
484-
cell->bytes = DIV_ROUND_UP(cell->nbits + cell->bit_offset,
485-
BITS_PER_BYTE);
484+
cell->bytes = round_up(DIV_ROUND_UP(cell->nbits + cell->bit_offset,
485+
BITS_PER_BYTE), nvmem->word_size);
486486

487487
if (!IS_ALIGNED(cell->offset, nvmem->stride)) {
488488
dev_err(&nvmem->dev,

0 commit comments

Comments
 (0)