aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-07-03 18:04:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:37 -0400
commit76feaedeb9f33011c7048d4339d18c3fd342f984 (patch)
tree29c49689e379596a393c053f14f8e35296029770 /arch
parent1132137e87898d0b6786d85a99de35ce196ecbfb (diff)
mm/mn10300: 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> Cc: David Howells <dhowells@redhat.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mn10300/mm/init.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/arch/mn10300/mm/init.c b/arch/mn10300/mm/init.c
index 7590d91627f2..97a1ec0beeec 100644
--- a/arch/mn10300/mm/init.c
+++ b/arch/mn10300/mm/init.c
@@ -99,15 +99,12 @@ void __init paging_init(void)
99 */ 99 */
100void __init mem_init(void) 100void __init mem_init(void)
101{ 101{
102 int codesize, reservedpages, datasize, initsize;
103 int tmp;
104
105 BUG_ON(!mem_map); 102 BUG_ON(!mem_map);
106 103
107#define START_PFN (contig_page_data.bdata->node_min_pfn) 104#define START_PFN (contig_page_data.bdata->node_min_pfn)
108#define MAX_LOW_PFN (contig_page_data.bdata->node_low_pfn) 105#define MAX_LOW_PFN (contig_page_data.bdata->node_low_pfn)
109 106
110 max_mapnr = num_physpages = MAX_LOW_PFN - START_PFN; 107 max_mapnr = MAX_LOW_PFN - START_PFN;
111 high_memory = (void *) __va(MAX_LOW_PFN * PAGE_SIZE); 108 high_memory = (void *) __va(MAX_LOW_PFN * PAGE_SIZE);
112 109
113 /* clear the zero-page */ 110 /* clear the zero-page */
@@ -116,26 +113,7 @@ void __init mem_init(void)
116 /* this will put all low memory onto the freelists */ 113 /* this will put all low memory onto the freelists */
117 free_all_bootmem(); 114 free_all_bootmem();
118 115
119 reservedpages = 0; 116 mem_init_print_info(NULL);
120 for (tmp = 0; tmp < num_physpages; tmp++)
121 if (PageReserved(&mem_map[tmp]))
122 reservedpages++;
123
124 codesize = (unsigned long) &_etext - (unsigned long) &_stext;
125 datasize = (unsigned long) &_edata - (unsigned long) &_etext;
126 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
127
128 printk(KERN_INFO
129 "Memory: %luk/%luk available"
130 " (%dk kernel code, %dk reserved, %dk data, %dk init,"
131 " %ldk highmem)\n",
132 nr_free_pages() << (PAGE_SHIFT - 10),
133 max_mapnr << (PAGE_SHIFT - 10),
134 codesize >> 10,
135 reservedpages << (PAGE_SHIFT - 10),
136 datasize >> 10,
137 initsize >> 10,
138 totalhigh_pages << (PAGE_SHIFT - 10));
139} 117}
140 118
141/* 119/*