Skip to content

Commit d2e639d

Browse files
Dan Carpentermiquelraynal
authored andcommitted
mtd: rawnand: ingenic: cleanup ARRAY_SIZE() vs sizeof() use
The ARRAY_SIZE() is the number of elements but we want to use sizeof() here for the number of bytes. Fortunately, they are the same thing because it's an array of u8 so this has no effect on runtime. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/20200624132640.GC9972@mwanda
1 parent 91e8115 commit d2e639d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mtd/nand/raw/ingenic/jz4740_ecc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ static int jz4740_ecc_calculate(struct ingenic_ecc *ecc,
9090
* If the written data is completely 0xff, we also want to write 0xff as
9191
* ECC, otherwise we will get in trouble when doing subpage writes.
9292
*/
93-
if (memcmp(ecc_code, empty_block_ecc, ARRAY_SIZE(empty_block_ecc)) == 0)
94-
memset(ecc_code, 0xff, ARRAY_SIZE(empty_block_ecc));
93+
if (memcmp(ecc_code, empty_block_ecc, sizeof(empty_block_ecc)) == 0)
94+
memset(ecc_code, 0xff, sizeof(empty_block_ecc));
9595

9696
return 0;
9797
}

0 commit comments

Comments
 (0)