Skip to content

Commit 74f9c91

Browse files
svenpeter42marcan
authored andcommitted
nvmem: round up to word_size
Signed-off-by: Sven Peter <[email protected]>
1 parent 5356b17 commit 74f9c91

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
@@ -480,8 +480,8 @@ static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,
480480
cell->np = info->np;
481481

482482
if (cell->nbits)
483-
cell->bytes = DIV_ROUND_UP(cell->nbits + cell->bit_offset,
484-
BITS_PER_BYTE);
483+
cell->bytes = round_up(DIV_ROUND_UP(cell->nbits + cell->bit_offset,
484+
BITS_PER_BYTE), nvmem->word_size);
485485

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

0 commit comments

Comments
 (0)