Skip to content

Commit 71fbd55

Browse files
Zhang Zhentorvalds
authored andcommitted
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>
1 parent 9dc00f4 commit 71fbd55

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/base/memory.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
228228
struct page *first_page;
229229
int ret;
230230

231-
first_page = pfn_to_page(phys_index << PFN_SECTION_SHIFT);
232-
start_pfn = page_to_pfn(first_page);
231+
start_pfn = phys_index << PFN_SECTION_SHIFT;
232+
first_page = pfn_to_page(start_pfn);
233233

234234
switch (action) {
235235
case MEM_ONLINE:

0 commit comments

Comments
 (0)