summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-06-23 00:56:46 +0800
committerTom Rini <trini@ti.com>2013-06-26 10:26:06 -0400
commit31bf0f57b2c322500ceccdc6a38b4a8edb7035f0 (patch)
treeb8698bbdbec23ce45efe9ab0d6c07bcdae4de22c /drivers
parentb98bfeb6674bd33effe9e093f071e7eeb3174f2e (diff)
downloadu-boot-imx-31bf0f57b2c322500ceccdc6a38b4a8edb7035f0.zip
u-boot-imx-31bf0f57b2c322500ceccdc6a38b4a8edb7035f0.tar.gz
u-boot-imx-31bf0f57b2c322500ceccdc6a38b4a8edb7035f0.tar.bz2
mtd: cfi_flash: Use ARRAY_SIZE at appropriate places
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/cfi_flash.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 25f8752..25a5710 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1797,7 +1797,7 @@ static int flash_detect_legacy(phys_addr_t base, int banknum)
};
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->start[0] =
(ulong)map_physmem(base,
@@ -1883,8 +1883,7 @@ static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry)
/* Issue FLASH reset command */
flash_cmd_reset(info);
- for (cfi_offset=0;
- cfi_offset < sizeof(flash_offset_cfi) / sizeof(uint);
+ for (cfi_offset = 0; cfi_offset < ARRAY_SIZE(flash_offset_cfi);
cfi_offset++) {
flash_write_cmd (info, 0, flash_offset_cfi[cfi_offset],
FLASH_CMD_CFI);
@@ -2336,7 +2335,7 @@ void flash_protect_default(void)
#endif
#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",
apl[i].start, apl[i].start + apl[i].size - 1);
flash_protect(FLAG_PROTECT_SET,