summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/amd_flash.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-03-31 02:29:45 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-31 12:18:48 -0800
commit87d10f3c7954d143e509a2af2bca2a27aeb3114d (patch)
treedadb374a0019895f26ceca4ade9291e8f52c784b /drivers/mtd/chips/amd_flash.c
parent54af6b46485bb706b7cdffd2e419253fd00cae6a (diff)
downloadop-kernel-dev-87d10f3c7954d143e509a2af2bca2a27aeb3114d.zip
op-kernel-dev-87d10f3c7954d143e509a2af2bca2a27aeb3114d.tar.gz
[PATCH] drivers/mtd: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of the macro. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mtd/chips/amd_flash.c')
-rw-r--r--drivers/mtd/chips/amd_flash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/chips/amd_flash.c b/drivers/mtd/chips/amd_flash.c
index fdb91b6..5711561 100644
--- a/drivers/mtd/chips/amd_flash.c
+++ b/drivers/mtd/chips/amd_flash.c
@@ -664,7 +664,7 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
printk("%s: Probing for AMD compatible flash...\n", map->name);
if ((table_pos[0] = probe_new_chip(mtd, 0, NULL, &temp, table,
- sizeof(table)/sizeof(table[0])))
+ ARRAY_SIZE(table)))
== -1) {
printk(KERN_WARNING
"%s: Found no AMD compatible device at location zero\n",
@@ -696,7 +696,7 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
base += (1 << temp.chipshift)) {
int numchips = temp.numchips;
table_pos[numchips] = probe_new_chip(mtd, base, chips,
- &temp, table, sizeof(table)/sizeof(table[0]));
+ &temp, table, ARRAY_SIZE(table));
}
mtd->eraseregions = kmalloc(sizeof(struct mtd_erase_region_info) *
OpenPOWER on IntegriCloud