aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSheng Yong <shengyong1@huawei.com>2015-04-14 18:44:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 19:49:00 -0400
commit19c07d5e0414261bd7ec3d8419dd26f468ef69d9 (patch)
tree51cf67b5ebd9d96bfe2514fe128576ecca257581
parent1575e68b3c1111aca9779ecbdb106a4aa563f01f (diff)
memory hotplug: use macro to switch between section and pfn
Use macro section_nr_to_pfn() to switch between section and pfn, instead of open-coding it. No semantic changes. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/base/memory.c2
-rw-r--r--mm/memory_hotplug.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index af9c911cd6b5..ab5c9a7dfeca 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -228,7 +228,7 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
228 struct page *first_page; 228 struct page *first_page;
229 int ret; 229 int ret;
230 230
231 start_pfn = phys_index << PFN_SECTION_SHIFT; 231 start_pfn = section_nr_to_pfn(phys_index);
232 first_page = pfn_to_page(start_pfn); 232 first_page = pfn_to_page(start_pfn);
233 233
234 switch (action) { 234 switch (action) {
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 65842d688b7c..aaec7758eec3 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -502,7 +502,7 @@ int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn,
502 end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1); 502 end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);
503 503
504 for (i = start_sec; i <= end_sec; i++) { 504 for (i = start_sec; i <= end_sec; i++) {
505 err = __add_section(nid, zone, i << PFN_SECTION_SHIFT); 505 err = __add_section(nid, zone, section_nr_to_pfn(i));
506 506
507 /* 507 /*
508 * EEXIST is finally dealt with by ioresource collision 508 * EEXIST is finally dealt with by ioresource collision