Skip to content

Commit

Permalink
mm: use pgdat_end_pfn() to simplify the code in arch
Browse files Browse the repository at this point in the history
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]>
Cc: James Hogan <[email protected]>
Cc: "Luck, Tony" <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Paul Mundt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Xishi Qiu authored and torvalds committed Nov 13, 2013
1 parent 8bfa3f9 commit 6408068
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion arch/metag/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,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;
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,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
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 6408068

Please sign in to comment.