Commit 9671468f authored by Jiang Liu's avatar Jiang Liu Committed by Linus Torvalds

mm/m68k: prepare for removing num_physpages and simplify mem_init()

Prepare for removing num_physpages and simplify mem_init().
Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Acked-by: default avatarGreg Ungerer <gerg@uclinux.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a0e7b805
...@@ -149,33 +149,11 @@ void __init print_memmap(void) ...@@ -149,33 +149,11 @@ void __init print_memmap(void)
void __init mem_init(void) void __init mem_init(void)
{ {
pg_data_t *pgdat; pg_data_t *pgdat;
int codepages = 0;
int datapages = 0;
int initpages = 0;
int i; int i;
/* this will put all memory onto the freelists */ /* this will put all memory onto the freelists */
num_physpages = 0; for_each_online_pgdat(pgdat)
for_each_online_pgdat(pgdat) {
num_physpages += pgdat->node_present_pages;
free_all_bootmem_node(pgdat); free_all_bootmem_node(pgdat);
for (i = 0; i < pgdat->node_spanned_pages; i++) {
struct page *page = pgdat->node_mem_map + i;
char *addr = page_to_virt(page);
if (!PageReserved(page))
continue;
if (addr >= _text &&
addr < _etext)
codepages++;
else if (addr >= __init_begin &&
addr < __init_end)
initpages++;
else
datapages++;
}
}
#if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE) #if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
/* insert pointer tables allocated so far into the tablelist */ /* insert pointer tables allocated so far into the tablelist */
...@@ -190,12 +168,7 @@ void __init mem_init(void) ...@@ -190,12 +168,7 @@ void __init mem_init(void)
init_pointer_table((unsigned long)zero_pgtable); init_pointer_table((unsigned long)zero_pgtable);
#endif #endif
pr_info("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n", mem_init_print_info(NULL);
nr_free_pages() << (PAGE_SHIFT-10),
totalram_pages << (PAGE_SHIFT-10),
codepages << (PAGE_SHIFT-10),
datapages << (PAGE_SHIFT-10),
initpages << (PAGE_SHIFT-10));
print_memmap(); print_memmap();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment