From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: wangnan0@huawei.com,
Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
Linux MM <linux-mm@kvack.org>,
David Rientjes <rientjes@google.com>,
Dave Hansen <dave.hansen@intel.com>
Subject: [PATCH v2] memory-hotplug: remove redundant call of page_to_pfn
Date: Wed, 12 Nov 2014 11:56:02 +0800 [thread overview]
Message-ID: <5462DA52.7040100@huawei.com> (raw)
In-Reply-To: <1415764673-32152-1-git-send-email-zhenzhang.zhang@huawei.com>
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.
v2:
added the purpose of the patch to the description.
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
---
drivers/base/memory.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7c5d871..85be040 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:
--
1.8.1.4
.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
parent reply other threads:[~2014-11-12 3:56 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1415764673-32152-1-git-send-email-zhenzhang.zhang@huawei.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5462DA52.7040100@huawei.com \
--to=zhenzhang.zhang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.