Skip to content

Commit 25242b3

Browse files
svenpeter42jannau
authored andcommitted
nvmem: round up to word_size
Signed-off-by: Sven Peter <sven@svenpeter.dev>
1 parent 1416458 commit 25242b3

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

567567
if (cell->nbits)
568-
cell->bytes = DIV_ROUND_UP(cell->nbits + cell->bit_offset,
569-
BITS_PER_BYTE);
568+
cell->bytes = round_up(DIV_ROUND_UP(cell->nbits + cell->bit_offset,
569+
BITS_PER_BYTE), nvmem->word_size);
570570

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

0 commit comments

Comments
 (0)