[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:
committed by
Linus Torvalds
parent
54af6b4648
commit
87d10f3c79
@@ -126,8 +126,6 @@ static struct mtd_partition alchemy_partitions[] = {
|
||||
}
|
||||
};
|
||||
|
||||
#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
|
||||
|
||||
static struct mtd_info *mymtd;
|
||||
|
||||
int __init alchemy_mtd_init(void)
|
||||
@@ -154,7 +152,7 @@ int __init alchemy_mtd_init(void)
|
||||
* Static partition definition selection
|
||||
*/
|
||||
parts = alchemy_partitions;
|
||||
nb_parts = NB_OF(alchemy_partitions);
|
||||
nb_parts = ARRAY_SIZE(alchemy_partitions);
|
||||
alchemy_map.size = window_size;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user