summaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
authorZhang Zhen <zhenzhang.zhang@huawei.com>2014-12-13 01:55:33 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 21:42:47 +0100
commit71fbd556adde2795787a6ca4c16871e57efba847 (patch)
treea4302fe87369d15c20bcecd0b38d383af813cef8 /drivers/base/memory.c
parentiommu/amd: use handle_mm_fault directly (diff)
downloadlinux-71fbd556adde2795787a6ca4c16871e57efba847.tar.xz
linux-71fbd556adde2795787a6ca4c16871e57efba847.zip
memory-hotplug: remove redundant call of page_to_pfn
This is just a small optimization. The start_pfn can be obtained directly by phys_index << PFN_SECTION_SHIFT. So the call of page_to_pfn() is redundant and remove it. Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com> Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: David Rientjes <rientjes@google.com> Cc: Dave Hansen <dave@sr71.net> Cc: Wang Nan <wangnan0@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r--drivers/base/memory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7c5d87191b28..85be040a21c8 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -228,8 +228,8 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
struct page *first_page;
int ret;
- first_page = pfn_to_page(phys_index << PFN_SECTION_SHIFT);
- start_pfn = page_to_pfn(first_page);
+ start_pfn = phys_index << PFN_SECTION_SHIFT;
+ first_page = pfn_to_page(start_pfn);
switch (action) {
case MEM_ONLINE: