[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
@@ -64,7 +64,7 @@ static struct mtd_partition ts5500_partitions[] = {
|
||||
}
|
||||
};
|
||||
|
||||
#define NUM_PARTITIONS (sizeof(ts5500_partitions)/sizeof(struct mtd_partition))
|
||||
#define NUM_PARTITIONS ARRAY_SIZE(ts5500_partitions)
|
||||
|
||||
static struct mtd_info *mymtd;
|
||||
|
||||
|
Reference in New Issue
Block a user