mm/ARC: prepare for removing num_physpages and simplify mem_init()
authorJiang Liu <liuj97@gmail.com>
Wed, 3 Jul 2013 22:03:47 +0000 (15:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Jul 2013 23:07:35 +0000 (16:07 -0700)
Prepare for removing num_physpages and simplify mem_init().

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com> # for arch/arc
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arc/mm/init.c

index c668a60..a08ce71 100644 (file)
@@ -74,7 +74,7 @@ void __init setup_arch_memory(void)
        /* Last usable page of low mem (no HIGHMEM yet for ARC port) */
        max_low_pfn = max_pfn = PFN_DOWN(end_mem);
 
-       max_mapnr = num_physpages = max_low_pfn - min_low_pfn;
+       max_mapnr = max_low_pfn - min_low_pfn;
 
        /*------------- reserve kernel image -----------------------*/
        memblock_reserve(CONFIG_LINUX_LINK_BASE,
@@ -84,7 +84,7 @@ void __init setup_arch_memory(void)
 
        /*-------------- node setup --------------------------------*/
        memset(zones_size, 0, sizeof(zones_size));
-       zones_size[ZONE_NORMAL] = num_physpages;
+       zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn;
 
        /*
         * We can't use the helper free_area_init(zones[]) because it uses
@@ -106,39 +106,9 @@ void __init setup_arch_memory(void)
  */
 void __init mem_init(void)
 {
-       int codesize, datasize, initsize, reserved_pages, free_pages;
-       int tmp;
-
        high_memory = (void *)(CONFIG_LINUX_LINK_BASE + arc_mem_sz);
-
        free_all_bootmem();
-
-       /* count all reserved pages [kernel code/data/mem_map..] */
-       reserved_pages = 0;
-       for (tmp = 0; tmp < max_mapnr; tmp++)
-               if (PageReserved(mem_map + tmp))
-                       reserved_pages++;
-
-       /* XXX: nr_free_pages() is equivalent */
-       free_pages = max_mapnr - reserved_pages;
-
-       /*
-        * For the purpose of display below, split the "reserve mem"
-        * kernel code/data is already shown explicitly,
-        * Show any other reservations (mem_map[ ] et al)
-        */
-       reserved_pages -= (((unsigned int)_end - CONFIG_LINUX_LINK_BASE) >>
-                                                               PAGE_SHIFT);
-
-       codesize = _etext - _text;
-       datasize = _end - _etext;
-       initsize = __init_end - __init_begin;
-
-       pr_info("Memory Available: %dM / %ldM (%dK code, %dK data, %dK init, %dK reserv)\n",
-               PAGES_TO_MB(free_pages),
-               TO_MB(arc_mem_sz),
-               TO_KB(codesize), TO_KB(datasize), TO_KB(initsize),
-               PAGES_TO_KB(reserved_pages));
+       mem_init_print_info(NULL);
 }
 
 /*