[AVR32] Use ARRAY_SIZE macro when appropriate
authorAhmed S. Darwish <darwish.07@gmail.com>
Mon, 5 Feb 2007 02:41:27 +0000 (04:41 +0200)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Fri, 9 Feb 2007 14:01:58 +0000 (15:01 +0100)
A patch to use ARRAY_SIZE macro already defined in linux/kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
arch/avr32/kernel/setup.c

index a34211601008420f456e185b825c9ed426eb51c7..c6734aefb559992e4eef8b4eb5d25b64ce0a6d6b 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
+#include <linux/kernel.h>
 
 #include <asm/sections.h>
 #include <asm/processor.h>
@@ -174,8 +175,7 @@ static int __init parse_tag_mem_range(struct tag *tag,
         * Copy the data so the bootmem init code doesn't need to care
         * about it.
         */
-       if (mem_range_next_free >=
-           (sizeof(mem_range_cache) / sizeof(mem_range_cache[0])))
+       if (mem_range_next_free >= ARRAY_SIZE(mem_range_cache))
                panic("Physical memory map too complex!\n");
 
        new = &mem_range_cache[mem_range_next_free++];