[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>
This commit is contained in:

committad av
Linus Torvalds

förälder
54af6b4648
incheckning
87d10f3c79
@@ -76,7 +76,7 @@ static struct mtd_partition partition_info[]={
|
||||
.size = 0x80000
|
||||
},
|
||||
};
|
||||
#define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0]))
|
||||
#define NUM_PARTITIONS ARRAY_SIZE(partition_info)
|
||||
|
||||
#define WINDOW_SIZE 0x00100000
|
||||
#define WINDOW_ADDR 0x00200000
|
||||
@@ -88,7 +88,7 @@ static struct map_info netsc520_map = {
|
||||
.phys = WINDOW_ADDR,
|
||||
};
|
||||
|
||||
#define NUM_FLASH_BANKS (sizeof(netsc520_map)/sizeof(struct map_info))
|
||||
#define NUM_FLASH_BANKS ARRAY_SIZE(netsc520_map)
|
||||
|
||||
static struct mtd_info *mymtd;
|
||||
|
||||
|
Referens i nytt ärende
Block a user