提交 19c07d5e 编写于 作者: S Sheng Yong 提交者: Linus Torvalds

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: NSheng Yong <shengyong1@huawei.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1575e68b
...@@ -228,7 +228,7 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t ...@@ -228,7 +228,7 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
struct page *first_page; struct page *first_page;
int ret; int ret;
start_pfn = phys_index << PFN_SECTION_SHIFT; start_pfn = section_nr_to_pfn(phys_index);
first_page = pfn_to_page(start_pfn); first_page = pfn_to_page(start_pfn);
switch (action) { switch (action) {
......
...@@ -502,7 +502,7 @@ int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn, ...@@ -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); end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);
for (i = start_sec; i <= end_sec; i++) { 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 * EEXIST is finally dealt with by ioresource collision
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册