aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-07-03 18:03:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:36 -0400
commit4e422de996da62e933dcc0fd3c2d7fe513cf32a2 (patch)
tree512ab0db4aea50f4ff21fd67b84c3e32eff8ca48
parent02f5532445c4aed57697b612e72b2a334eeb10ce (diff)
mm/cris: prepare for removing num_physpages and simplify mem_init()
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/cris/mm/init.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c
index 52b8b56ae305..c81af5bd9167 100644
--- a/arch/cris/mm/init.c
+++ b/arch/cris/mm/init.c
@@ -19,9 +19,6 @@ unsigned long empty_zero_page;
19void __init 19void __init
20mem_init(void) 20mem_init(void)
21{ 21{
22 int codesize, reservedpages, datasize, initsize;
23 unsigned long tmp;
24
25 BUG_ON(!mem_map); 22 BUG_ON(!mem_map);
26 23
27 /* max/min_low_pfn was set by setup.c 24 /* max/min_low_pfn was set by setup.c
@@ -29,35 +26,9 @@ mem_init(void)
29 * 26 *
30 * high_memory was also set in setup.c 27 * high_memory was also set in setup.c
31 */ 28 */
32 29 max_mapnr = max_low_pfn - min_low_pfn;
33 max_mapnr = num_physpages = max_low_pfn - min_low_pfn;
34
35 /* this will put all memory onto the freelists */
36 free_all_bootmem(); 30 free_all_bootmem();
37 31 mem_init_print_info(NULL);
38 reservedpages = 0;
39 for (tmp = 0; tmp < max_mapnr; tmp++) {
40 /*
41 * Only count reserved RAM pages
42 */
43 if (PageReserved(mem_map + tmp))
44 reservedpages++;
45 }
46
47 codesize = (unsigned long) &_etext - (unsigned long) &_stext;
48 datasize = (unsigned long) &_edata - (unsigned long) &_etext;
49 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
50
51 printk(KERN_INFO
52 "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, "
53 "%dk init)\n" ,
54 nr_free_pages() << (PAGE_SHIFT-10),
55 max_mapnr << (PAGE_SHIFT-10),
56 codesize >> 10,
57 reservedpages << (PAGE_SHIFT-10),
58 datasize >> 10,
59 initsize >> 10
60 );
61} 32}
62 33
63/* free the pages occupied by initialization code */ 34/* free the pages occupied by initialization code */