From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by kanga.kvack.org (Postfix) with ESMTP id 9CEE46B0129 for ; Tue, 11 Nov 2014 04:15:14 -0500 (EST) Received: by mail-pa0-f45.google.com with SMTP id lf10so10286731pab.32 for ; Tue, 11 Nov 2014 01:15:14 -0800 (PST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com. [119.145.14.66]) by mx.google.com with ESMTPS id dm8si243356pdb.15.2014.11.11.01.15.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Nov 2014 01:15:13 -0800 (PST) Message-ID: <5461D343.60803@huawei.com> Date: Tue, 11 Nov 2014 17:13:39 +0800 From: Zhang Zhen MIME-Version: 1.0 Subject: [PATCH] memory-hotplug: remove redundant call of page_to_pfn References: <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com> In-Reply-To: <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes , Andrew Morton , Dave Hansen , Linux MM , linux-kernel@vger.kernel.org Cc: wangnan0@huawei.com The start_pfn can be obtained directly by phys_index << PFN_SECTION_SHIFT. Signed-off-by: Zhang Zhen --- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbaKKJNy (ORCPT ); Tue, 11 Nov 2014 04:13:54 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:38552 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbaKKJNw (ORCPT ); Tue, 11 Nov 2014 04:13:52 -0500 Message-ID: <5461D343.60803@huawei.com> Date: Tue, 11 Nov 2014 17:13:39 +0800 From: Zhang Zhen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: David Rientjes , Andrew Morton , Dave Hansen , Linux MM , CC: Subject: [PATCH] memory-hotplug: remove redundant call of page_to_pfn References: <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com> In-Reply-To: <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com> X-Forwarded-Message-Id: <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.69.77] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020209.5461D34E.0137,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 33d34fd3bdc8e32130f576a369758c89 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The start_pfn can be obtained directly by phys_index << PFN_SECTION_SHIFT. Signed-off-by: Zhang Zhen --- 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 .