linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memory hotplug: Use macro to switch between section and pfn
@ 2015-02-13  9:13 Sheng Yong
  0 siblings, 0 replies; only message in thread
From: Sheng Yong @ 2015-02-13  9:13 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm

Use macro section_nr_to_pfn and pfn_to_section_nr to switch between section
and pfn, instead of bit operations, no semantic changes.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
 drivers/base/memory.c | 2 +-
 mm/memory_hotplug.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 85be040..8f6d988 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
 	struct page *first_page;
 	int ret;
 
-	start_pfn = phys_index << PFN_SECTION_SHIFT;
+	start_pfn = section_nr_to_pfn(phys_index);
 	first_page = pfn_to_page(start_pfn);
 
 	switch (action) {
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index b82b61e..2afda10 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,
 	end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);
 
 	for (i = start_sec; i <= end_sec; i++) {
-		err = __add_section(nid, zone, i << PFN_SECTION_SHIFT);
+		err = __add_section(nid, zone, section_nr_to_pfn(i));
 
 		/*
 		 * EEXIST is finally dealt with by ioresource collision
-- 
1.8.3.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-13  9:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13  9:13 [PATCH] memory hotplug: Use macro to switch between section and pfn Sheng Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox