x86 boot: proper use of ARRAY_SIZE instead of repeated E820MAX constant
[safe/jmp/linux-2.6] / arch / x86 / kernel / e820_64.c
index c10b4ae..58dc6ee 100644 (file)
@@ -413,7 +413,9 @@ char *__init machine_specific_memory_setup(void)
         * Otherwise fake a memory map; one section from 0k->640k,
         * the next section from 1mb->appropriate_mem_k
         */
-       sanitize_e820_map(boot_params.e820_map, &boot_params.e820_entries);
+       sanitize_e820_map(boot_params.e820_map,
+                       ARRAY_SIZE(boot_params.e820_map),
+                       &boot_params.e820_entries);
        if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0)
                early_panic("Cannot find a valid memory map");
        printk(KERN_INFO "BIOS-provided physical RAM map:\n");
@@ -484,7 +486,7 @@ void __init finish_e820_parsing(void)
        if (userdef) {
                char nr = e820.nr_map;
 
-               if (sanitize_e820_map(e820.map, &nr) < 0)
+               if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0)
                        early_panic("Invalid user supplied memory map");
                e820.nr_map = nr;