diff options
author | Xishi Qiu <qiuxishi@huawei.com> | 2013-11-12 18:07:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:03 -0500 |
commit | 83285c72e08c42848808039ef2d3b67a1bb88832 (patch) | |
tree | 96deaa3deb9a9f5b5b3c5b03f5982eeaea401670 /mm/memory_hotplug.c | |
parent | 6408068ee6ce9d80d66908a2c01a24ee88afd47d (diff) |
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: Xishi Qiu <qiuxishi@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index ed85fe3870e2..375a42d76b2c 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -365,8 +365,7 @@ out_fail: | |||
365 | static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn, | 365 | static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn, |
366 | unsigned long end_pfn) | 366 | unsigned long end_pfn) |
367 | { | 367 | { |
368 | unsigned long old_pgdat_end_pfn = | 368 | unsigned long old_pgdat_end_pfn = pgdat_end_pfn(pgdat); |
369 | pgdat->node_start_pfn + pgdat->node_spanned_pages; | ||
370 | 369 | ||
371 | if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn) | 370 | if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn) |
372 | pgdat->node_start_pfn = start_pfn; | 371 | pgdat->node_start_pfn = start_pfn; |
@@ -579,9 +578,9 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn, | |||
579 | static void shrink_pgdat_span(struct pglist_data *pgdat, | 578 | static void shrink_pgdat_span(struct pglist_data *pgdat, |
580 | unsigned long start_pfn, unsigned long end_pfn) | 579 | unsigned long start_pfn, unsigned long end_pfn) |
581 | { | 580 | { |
582 | unsigned long pgdat_start_pfn = pgdat->node_start_pfn; | 581 | unsigned long pgdat_start_pfn = pgdat->node_start_pfn; |
583 | unsigned long pgdat_end_pfn = | 582 | unsigned long p = pgdat_end_pfn(pgdat); /* pgdat_end_pfn namespace clash */ |
584 | pgdat->node_start_pfn + pgdat->node_spanned_pages; | 583 | unsigned long pgdat_end_pfn = p; |
585 | unsigned long pfn; | 584 | unsigned long pfn; |
586 | struct mem_section *ms; | 585 | struct mem_section *ms; |
587 | int nid = pgdat->node_id; | 586 | int nid = pgdat->node_id; |