Skip to content

Commit

Permalink
mtd: rawnand: ingenic: cleanup ARRAY_SIZE() vs sizeof() use
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200624132640.GC9972@mwanda
  • Loading branch information
Dan Carpenter authored and Miquel Raynal committed Jul 7, 2020
1 parent 91e8115 commit d2e639d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/nand/raw/ingenic/jz4740_ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ static int jz4740_ecc_calculate(struct ingenic_ecc *ecc,
* If the written data is completely 0xff, we also want to write 0xff as
* ECC, otherwise we will get in trouble when doing subpage writes.
*/
if (memcmp(ecc_code, empty_block_ecc, ARRAY_SIZE(empty_block_ecc)) == 0)
memset(ecc_code, 0xff, ARRAY_SIZE(empty_block_ecc));
if (memcmp(ecc_code, empty_block_ecc, sizeof(empty_block_ecc)) == 0)
memset(ecc_code, 0xff, sizeof(empty_block_ecc));

return 0;
}
Expand Down

0 comments on commit d2e639d

Please sign in to comment.