From: Zhang Zhen Date: Sat, 13 Dec 2014 00:55:33 +0000 (-0800) Subject: memory-hotplug: remove redundant call of page_to_pfn X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=71fbd556adde2795787a6ca4c16871e57efba847;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Yasuaki Ishimatsu Acked-by: David Rientjes Cc: Dave Hansen Cc: Wang Nan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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: