]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/AVR32: prepare for killing free_all_bootmem_node()
authorJiang Liu <liuj97@gmail.com>
Thu, 27 Jun 2013 23:52:03 +0000 (09:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:51 +0000 (16:37 +1000)
Prepare for killing free_all_bootmem_node() by using free_all_bootmem()
instead.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/avr32/mm/init.c

index 0fc04b9323cfdcc126705ea4cad54da3b28ccccc..def5391d927ac353682e1607162d1770365840cf 100644 (file)
@@ -103,23 +103,12 @@ void __init mem_init(void)
        pg_data_t *pgdat;
 
        high_memory = NULL;
+       for_each_online_pgdat(pgdat)
+               high_memory = max_t(void *, high_memory,
+                                   __va(pgdat_end_pfn(pgdat) << PAGE_SHIFT));
 
-       /* this will put all low memory onto the freelists */
-       for_each_online_pgdat(pgdat) {
-               void *node_high_memory;
-
-               if (pgdat->node_spanned_pages != 0)
-                       free_all_bootmem_node(pgdat);
-
-               node_high_memory = (void *)((pgdat->node_start_pfn
-                                            + pgdat->node_spanned_pages)
-                                           << PAGE_SHIFT);
-               if (node_high_memory > high_memory)
-                       high_memory = node_high_memory;
-       }
-
-       max_mapnr = MAP_NR(high_memory);
-
+       set_max_mapnr(MAP_NR(high_memory));
+       free_all_bootmem();
        mem_init_print_info(NULL);
 }