]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/ARC: prepare for removing num_physpages and simplify mem_init()
authorJiang Liu <liuj97@gmail.com>
Thu, 27 Jun 2013 23:51:53 +0000 (09:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:46 +0000 (16:37 +1000)
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>
arch/arc/mm/init.c

index c668a600f652b7f85ace70c698eb023cc06541fc..a08ce71854233e05510d45fc1183c19ecd35cb7c 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);
 }
 
 /*