diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2006-03-31 05:29:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 15:18:48 -0500 |
commit | 87d10f3c7954d143e509a2af2bca2a27aeb3114d (patch) | |
tree | dadb374a0019895f26ceca4ade9291e8f52c784b /drivers/mtd/maps/ocotea.c | |
parent | 54af6b46485bb706b7cdffd2e419253fd00cae6a (diff) |
[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/maps/ocotea.c')
-rw-r--r-- | drivers/mtd/maps/ocotea.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/maps/ocotea.c b/drivers/mtd/maps/ocotea.c index c223514ca2eb..a21fcd195ab4 100644 --- a/drivers/mtd/maps/ocotea.c +++ b/drivers/mtd/maps/ocotea.c | |||
@@ -58,8 +58,6 @@ static struct mtd_partition ocotea_large_partitions[] = { | |||
58 | } | 58 | } |
59 | }; | 59 | }; |
60 | 60 | ||
61 | #define NB_OF(x) (sizeof(x)/sizeof(x[0])) | ||
62 | |||
63 | int __init init_ocotea(void) | 61 | int __init init_ocotea(void) |
64 | { | 62 | { |
65 | u8 fpga0_reg; | 63 | u8 fpga0_reg; |
@@ -97,7 +95,7 @@ int __init init_ocotea(void) | |||
97 | if (flash) { | 95 | if (flash) { |
98 | flash->owner = THIS_MODULE; | 96 | flash->owner = THIS_MODULE; |
99 | add_mtd_partitions(flash, ocotea_small_partitions, | 97 | add_mtd_partitions(flash, ocotea_small_partitions, |
100 | NB_OF(ocotea_small_partitions)); | 98 | ARRAY_SIZE(ocotea_small_partitions)); |
101 | } else { | 99 | } else { |
102 | printk("map probe failed for flash\n"); | 100 | printk("map probe failed for flash\n"); |
103 | return -ENXIO; | 101 | return -ENXIO; |
@@ -118,7 +116,7 @@ int __init init_ocotea(void) | |||
118 | if (flash) { | 116 | if (flash) { |
119 | flash->owner = THIS_MODULE; | 117 | flash->owner = THIS_MODULE; |
120 | add_mtd_partitions(flash, ocotea_large_partitions, | 118 | add_mtd_partitions(flash, ocotea_large_partitions, |
121 | NB_OF(ocotea_large_partitions)); | 119 | ARRAY_SIZE(ocotea_large_partitions)); |
122 | } else { | 120 | } else { |
123 | printk("map probe failed for flash\n"); | 121 | printk("map probe failed for flash\n"); |
124 | return -ENXIO; | 122 | return -ENXIO; |