Skip to content

Commit da61efc

Browse files
jiangliutorvalds
authored andcommitted
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>
1 parent ad94198 commit da61efc

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

‎arch/sh/mm/init.c‎

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -407,24 +407,18 @@ unsigned int mem_init_done = 0;
407407

408408
void __init mem_init(void)
409409
{
410-
int codesize, datasize, initsize;
411-
int nid;
410+
pg_data_t *pgdat;
412411

413412
iommu_init();
414413

415-
num_physpages = 0;
416414
high_memory = NULL;
417415

418-
for_each_online_node(nid) {
419-
pg_data_t *pgdat = NODE_DATA(nid);
416+
for_each_online_pgdat(pgdat) {
420417
void *node_high_memory;
421418

422-
num_physpages += pgdat->node_present_pages;
423-
424419
if (pgdat->node_spanned_pages)
425420
free_all_bootmem_node(pgdat);
426421

427-
428422
node_high_memory = (void *)__va((pgdat->node_start_pfn +
429423
pgdat->node_spanned_pages) <<
430424
PAGE_SHIFT);
@@ -441,19 +435,8 @@ void __init mem_init(void)
441435

442436
vsyscall_init();
443437

444-
codesize = (unsigned long) &_etext - (unsigned long) &_text;
445-
datasize = (unsigned long) &_edata - (unsigned long) &_etext;
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"
438+
mem_init_print_info(NULL);
439+
pr_info("virtual kernel memory layout:\n"
457440
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
458441
#ifdef CONFIG_HIGHMEM
459442
" pkmap : 0x%08lx - 0x%08lx (%4ld kB)\n"

0 commit comments

Comments
 (0)