Commit 83285c72 authored by Xishi Qiu's avatar Xishi Qiu Committed by Linus Torvalds

mm: use pgdat_end_pfn() to simplify the code in others

Use "pgdat_end_pfn()" instead of "pgdat->node_start_pfn +
pgdat->node_spanned_pages".  Simplify the code, no functional change.
Signed-off-by: default avatarXishi Qiu <qiuxishi@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6408068e
...@@ -255,8 +255,7 @@ static int kcore_update_ram(void) ...@@ -255,8 +255,7 @@ static int kcore_update_ram(void)
end_pfn = 0; end_pfn = 0;
for_each_node_state(nid, N_MEMORY) { for_each_node_state(nid, N_MEMORY) {
unsigned long node_end; unsigned long node_end;
node_end = NODE_DATA(nid)->node_start_pfn + node_end = node_end_pfn(nid);
NODE_DATA(nid)->node_spanned_pages;
if (end_pfn < node_end) if (end_pfn < node_end)
end_pfn = node_end; end_pfn = node_end;
} }
......
...@@ -784,7 +784,7 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, ...@@ -784,7 +784,7 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
/* update goal according ...MAX_DMA32_PFN */ /* update goal according ...MAX_DMA32_PFN */
end_pfn = pgdat->node_start_pfn + pgdat->node_spanned_pages; end_pfn = pgdat_end_pfn(pgdat);
if (end_pfn > MAX_DMA32_PFN + (128 >> (20 - PAGE_SHIFT)) && if (end_pfn > MAX_DMA32_PFN + (128 >> (20 - PAGE_SHIFT)) &&
(goal >> PAGE_SHIFT) < MAX_DMA32_PFN) { (goal >> PAGE_SHIFT) < MAX_DMA32_PFN) {
......
...@@ -365,8 +365,7 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2, ...@@ -365,8 +365,7 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2,
static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn, static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn,
unsigned long end_pfn) unsigned long end_pfn)
{ {
unsigned long old_pgdat_end_pfn = unsigned long old_pgdat_end_pfn = pgdat_end_pfn(pgdat);
pgdat->node_start_pfn + pgdat->node_spanned_pages;
if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn) if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn)
pgdat->node_start_pfn = start_pfn; pgdat->node_start_pfn = start_pfn;
...@@ -579,9 +578,9 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn, ...@@ -579,9 +578,9 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
static void shrink_pgdat_span(struct pglist_data *pgdat, static void shrink_pgdat_span(struct pglist_data *pgdat,
unsigned long start_pfn, unsigned long end_pfn) unsigned long start_pfn, unsigned long end_pfn)
{ {
unsigned long pgdat_start_pfn = pgdat->node_start_pfn; unsigned long pgdat_start_pfn = pgdat->node_start_pfn;
unsigned long pgdat_end_pfn = unsigned long p = pgdat_end_pfn(pgdat); /* pgdat_end_pfn namespace clash */
pgdat->node_start_pfn + pgdat->node_spanned_pages; unsigned long pgdat_end_pfn = p;
unsigned long pfn; unsigned long pfn;
struct mem_section *ms; struct mem_section *ms;
int nid = pgdat->node_id; int nid = pgdat->node_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment