Skip to content

Commit 6408068

Browse files
Xishi Qiutorvalds
authored andcommitted
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 <qiuxishi@huawei.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8bfa3f9 commit 6408068

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎arch/ia64/mm/init.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,7 @@ int vmemmap_find_next_valid_pfn(int node, int i)
357357

358358
end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
359359
end_address = PAGE_ALIGN(end_address);
360-
361-
stop_address = (unsigned long) &vmem_map[
362-
pgdat->node_start_pfn + pgdat->node_spanned_pages];
360+
stop_address = (unsigned long) &vmem_map[pgdat_end_pfn(pgdat)];
363361

364362
do {
365363
pgd_t *pgd;

‎arch/metag/mm/init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static void __init bootmem_init_one_node(unsigned int nid)
148148
if (!p->node_spanned_pages)
149149
return;
150150

151-
end_pfn = p->node_start_pfn + p->node_spanned_pages;
151+
end_pfn = pgdat_end_pfn(p);
152152
#ifdef CONFIG_HIGHMEM
153153
if (end_pfn > max_low_pfn)
154154
end_pfn = max_low_pfn;

‎arch/powerpc/mm/numa.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,7 @@ static void __init mark_reserved_regions_for_nid(int nid)
938938
unsigned long start_pfn = physbase >> PAGE_SHIFT;
939939
unsigned long end_pfn = PFN_UP(physbase + size);
940940
struct node_active_region node_ar;
941-
unsigned long node_end_pfn = node->node_start_pfn +
942-
node->node_spanned_pages;
941+
unsigned long node_end_pfn = pgdat_end_pfn(node);
943942

944943
/*
945944
* Check to make sure that this memblock.reserved area is

‎arch/sh/mm/init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static void __init bootmem_init_one_node(unsigned int nid)
231231
if (!p->node_spanned_pages)
232232
return;
233233

234-
end_pfn = p->node_start_pfn + p->node_spanned_pages;
234+
end_pfn = pgdat_end_pfn(p);
235235

236236
total_pages = bootmem_bootmap_pages(p->node_spanned_pages);
237237

0 commit comments

Comments
 (0)