Skip to content

Commit 6215bea

Browse files
svenpeter42marcan
authored andcommitted
nvmem: round up to word_size
Signed-off-by: Sven Peter <[email protected]>
1 parent e527518 commit 6215bea

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

473473
if (cell->nbits)
474-
cell->bytes = DIV_ROUND_UP(cell->nbits + cell->bit_offset,
475-
BITS_PER_BYTE);
474+
cell->bytes = round_up(DIV_ROUND_UP(cell->nbits + cell->bit_offset,
475+
BITS_PER_BYTE), nvmem->word_size);
476476

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

0 commit comments

Comments
 (0)