diff options
author | Jiang Liu <liuj97@gmail.com> | 2013-07-03 18:04:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:37 -0400 |
commit | da61efcfedabf16e994d67f983588683f3d59837 (patch) | |
tree | d7ddca1ac995a4e12d7690999535a0d9c5a74200 /arch/sh/mm/init.c | |
parent | ad941989d0cf2ef1320ecf46ee1188df85e94b43 (diff) |
mm/SH: 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: Paul Mundt <lethal@linux-sh.org>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh/mm/init.c')
-rw-r--r-- | arch/sh/mm/init.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index fc0c8e1c32a7..c9a517c8bbb6 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -407,24 +407,18 @@ unsigned int mem_init_done = 0; | |||
407 | 407 | ||
408 | void __init mem_init(void) | 408 | void __init mem_init(void) |
409 | { | 409 | { |
410 | int codesize, datasize, initsize; | 410 | pg_data_t *pgdat; |
411 | int nid; | ||
412 | 411 | ||
413 | iommu_init(); | 412 | iommu_init(); |
414 | 413 | ||
415 | num_physpages = 0; | ||
416 | high_memory = NULL; | 414 | high_memory = NULL; |
417 | 415 | ||
418 | for_each_online_node(nid) { | 416 | for_each_online_pgdat(pgdat) { |
419 | pg_data_t *pgdat = NODE_DATA(nid); | ||
420 | void *node_high_memory; | 417 | void *node_high_memory; |
421 | 418 | ||
422 | num_physpages += pgdat->node_present_pages; | ||
423 | |||
424 | if (pgdat->node_spanned_pages) | 419 | if (pgdat->node_spanned_pages) |
425 | free_all_bootmem_node(pgdat); | 420 | free_all_bootmem_node(pgdat); |
426 | 421 | ||
427 | |||
428 | node_high_memory = (void *)__va((pgdat->node_start_pfn + | 422 | node_high_memory = (void *)__va((pgdat->node_start_pfn + |
429 | pgdat->node_spanned_pages) << | 423 | pgdat->node_spanned_pages) << |
430 | PAGE_SHIFT); | 424 | PAGE_SHIFT); |
@@ -441,19 +435,8 @@ void __init mem_init(void) | |||
441 | 435 | ||
442 | vsyscall_init(); | 436 | vsyscall_init(); |
443 | 437 | ||
444 | codesize = (unsigned long) &_etext - (unsigned long) &_text; | 438 | mem_init_print_info(NULL); |
445 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 439 | pr_info("virtual kernel memory layout:\n" |
446 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | ||
447 | |||
448 | printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, " | ||
449 | "%dk data, %dk init)\n", | ||
450 | nr_free_pages() << (PAGE_SHIFT-10), | ||
451 | num_physpages << (PAGE_SHIFT-10), | ||
452 | codesize >> 10, | ||
453 | datasize >> 10, | ||
454 | initsize >> 10); | ||
455 | |||
456 | printk(KERN_INFO "virtual kernel memory layout:\n" | ||
457 | " fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n" | 440 | " fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n" |
458 | #ifdef CONFIG_HIGHMEM | 441 | #ifdef CONFIG_HIGHMEM |
459 | " pkmap : 0x%08lx - 0x%08lx (%4ld kB)\n" | 442 | " pkmap : 0x%08lx - 0x%08lx (%4ld kB)\n" |