Skip to content
Snippets Groups Projects
Commit 31bf0f57 authored by Axel Lin's avatar Axel Lin Committed by Tom Rini
Browse files

mtd: cfi_flash: Use ARRAY_SIZE at appropriate places


Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
parent b98bfeb6
No related branches found
No related tags found
No related merge requests found
...@@ -1797,7 +1797,7 @@ static int flash_detect_legacy(phys_addr_t base, int banknum) ...@@ -1797,7 +1797,7 @@ static int flash_detect_legacy(phys_addr_t base, int banknum)
}; };
int i; int i;
for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++) { for (i = 0; i < ARRAY_SIZE(modes); i++) {
info->vendor = modes[i]; info->vendor = modes[i];
info->start[0] = info->start[0] =
(ulong)map_physmem(base, (ulong)map_physmem(base,
...@@ -1883,8 +1883,7 @@ static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry) ...@@ -1883,8 +1883,7 @@ static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry)
/* Issue FLASH reset command */ /* Issue FLASH reset command */
flash_cmd_reset(info); flash_cmd_reset(info);
for (cfi_offset=0; for (cfi_offset = 0; cfi_offset < ARRAY_SIZE(flash_offset_cfi);
cfi_offset < sizeof(flash_offset_cfi) / sizeof(uint);
cfi_offset++) { cfi_offset++) {
flash_write_cmd (info, 0, flash_offset_cfi[cfi_offset], flash_write_cmd (info, 0, flash_offset_cfi[cfi_offset],
FLASH_CMD_CFI); FLASH_CMD_CFI);
...@@ -2336,7 +2335,7 @@ void flash_protect_default(void) ...@@ -2336,7 +2335,7 @@ void flash_protect_default(void)
#endif #endif
#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST) #if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) { for (i = 0; i < ARRAY_SIZE(apl); i++) {
debug("autoprotecting from %08lx to %08lx\n", debug("autoprotecting from %08lx to %08lx\n",
apl[i].start, apl[i].start + apl[i].size - 1); apl[i].start, apl[i].start + apl[i].size - 1);
flash_protect(FLAG_PROTECT_SET, flash_protect(FLAG_PROTECT_SET,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment