]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/cris: prepare for removing num_physpages and simplify mem_init()
authorJiang Liu <liuj97@gmail.com>
Thu, 27 Jun 2013 23:51:55 +0000 (09:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:47 +0000 (16:37 +1000)
Prepare for removing num_physpages and simplify mem_init().

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/cris/mm/init.c

index 52b8b56ae305519d0937c1f1e50fd549efc43140..c81af5bd916792791ea05baf006270cf459fb26a 100644 (file)
@@ -19,9 +19,6 @@ unsigned long empty_zero_page;
 void __init
 mem_init(void)
 {
-       int codesize, reservedpages, datasize, initsize;
-       unsigned long tmp;
-
        BUG_ON(!mem_map);
 
        /* max/min_low_pfn was set by setup.c
@@ -29,35 +26,9 @@ mem_init(void)
         *
         * high_memory was also set in setup.c
         */
-
-       max_mapnr = num_physpages = max_low_pfn - min_low_pfn;
-       /* this will put all memory onto the freelists */
+       max_mapnr = max_low_pfn - min_low_pfn;
         free_all_bootmem();
-
-       reservedpages = 0;
-       for (tmp = 0; tmp < max_mapnr; tmp++) {
-               /*
-                 * Only count reserved RAM pages
-                 */
-               if (PageReserved(mem_map + tmp))
-                       reservedpages++;
-       }
-
-       codesize =  (unsigned long) &_etext - (unsigned long) &_stext;
-        datasize =  (unsigned long) &_edata - (unsigned long) &_etext;
-        initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
-       
-        printk(KERN_INFO
-               "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, "
-              "%dk init)\n" ,
-              nr_free_pages() << (PAGE_SHIFT-10),
-              max_mapnr << (PAGE_SHIFT-10),
-              codesize >> 10,
-              reservedpages << (PAGE_SHIFT-10),
-              datasize >> 10,
-              initsize >> 10
-               );
+       mem_init_print_info(NULL);
 }
 
 /* free the pages occupied by initialization code */