Commit 6408068ee6ce9d80d66908a2c01a24ee88afd47d

Authored by Xishi Qiu
Committed by Linus Torvalds
1 parent 8bfa3f9a01

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>

Showing 4 changed files with 4 additions and 7 deletions Side-by-side Diff

... ... @@ -357,9 +357,7 @@
357 357  
358 358 end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
359 359 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)];
363 361  
364 362 do {
365 363 pgd_t *pgd;
arch/metag/mm/init.c
... ... @@ -148,7 +148,7 @@
148 148 if (!p->node_spanned_pages)
149 149 return;
150 150  
151   - end_pfn = p->node_start_pfn + p->node_spanned_pages;
  151 + end_pfn = pgdat_end_pfn(p);
152 152 #ifdef CONFIG_HIGHMEM
153 153 if (end_pfn > max_low_pfn)
154 154 end_pfn = max_low_pfn;
arch/powerpc/mm/numa.c
... ... @@ -938,8 +938,7 @@
938 938 unsigned long start_pfn = physbase >> PAGE_SHIFT;
939 939 unsigned long end_pfn = PFN_UP(physbase + size);
940 940 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);
943 942  
944 943 /*
945 944 * Check to make sure that this memblock.reserved area is
... ... @@ -231,7 +231,7 @@
231 231 if (!p->node_spanned_pages)
232 232 return;
233 233  
234   - end_pfn = p->node_start_pfn + p->node_spanned_pages;
  234 + end_pfn = pgdat_end_pfn(p);
235 235  
236 236 total_pages = bootmem_bootmap_pages(p->node_spanned_pages);
237 237