mm: use pgdat_end_pfn() to simplify the code in arch
Subsystems (3)
PATCH 1/2 mm: use pgdat_end_pfn() to simplify the code in arch
Use "pgdat_end_pfn()" instead of "pgdat->node_start_pfn + pgdat->node_spanned_pages". Simplify the code, no functional change.
Signed-off-by Xishi Qiu <[email protected]>
--- arch/ia64/mm/init.c | 4 +--- arch/metag/mm/init.c | 2 +- arch/powerpc/mm/numa.c | 3 +-- arch/sh/mm/init.c | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-)
arch/ia64/mm/init.c +1 -3
@@ -357,9 +357,7 @@ int vmemmap_find_next_valid_pfn(int node, int i) end_address = (unsigned long ) &vmem_map[pgdat->node_start_pfn + i]; end_address =PAGE_ALIGN (end_address); - - stop_address = (unsigned long ) &vmem_map[ - pgdat->node_start_pfn + pgdat->node_spanned_pages]; + stop_address = (unsigned long ) &vmem_map[pgdat_end_pfn (pgdat)]; do { pgd_t *pgd;
arch/metag/mm/init.c +1 -1
@@ -149,7 +149,7 @@ static void __init bootmem_init_one_node(unsigned int nid)if (!p->node_spanned_pages)return ; - end_pfn = p->node_start_pfn + p->node_spanned_pages; + end_pfn =pgdat_end_pfn (p);#ifdef CONFIG_HIGHMEM if (end_pfn > max_low_pfn) end_pfn = max_low_pfn;
arch/powerpc/mm/numa.c +1 -2
@@ -935,8 +935,7 @@ static void __init mark_reserved_regions_for_nid(int nid)unsigned long start_pfn = physbase >>PAGE_SHIFT ;unsigned long end_pfn =PFN_UP (physbase + size);struct node_active_region node_ar; -unsigned long node_end_pfn = node->node_start_pfn + - node->node_spanned_pages; +unsigned long node_end_pfn =pgdat_end_pfn (node);/* * Check to make sure that this memblock.reserved area is
arch/sh/mm/init.c +1 -1
@@ -231,7 +231,7 @@ static void __init bootmem_init_one_node(unsigned int nid)if (!p->node_spanned_pages)return ; - end_pfn = p->node_start_pfn + p->node_spanned_pages; + end_pfn =pgdat_end_pfn (p); total_pages =bootmem_bootmap_pages (p->node_spanned_pages);
Signature · 8 lines
1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>