Commit 71fbd556 authored by Zhang Zhen's avatar Zhang Zhen Committed by Linus Torvalds
Browse files

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: default avatarZhang Zhen <>
Acked-by: default avatarYasuaki Ishimatsu <>
Acked-by: default avatarDavid Rientjes <>
Cc: Dave Hansen <>
Cc: Wang Nan <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 9dc00f4c
......@@ -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) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment