Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752499AbbBMJDO (ORCPT ); Fri, 13 Feb 2015 04:03:14 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:25290 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752042AbbBMJDL (ORCPT ); Fri, 13 Feb 2015 04:03:11 -0500 From: Sheng Yong To: , CC: Subject: [PATCH] memory hotplug: Use macro to switch between section and pfn Date: Fri, 13 Feb 2015 08:58:23 +0000 Message-ID: <1423817903-202206-1-git-send-email-shengyong1@huawei.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.197.200] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1523 Lines: 43 Use macro section_nr_to_pfn and pfn_to_section_nr to switch between section and pfn, instead of bit operations, no semantic changes. Signed-off-by: Sheng Yong --- drivers/base/memory.c | 2 +- mm/memory_hotplug.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 85be040..8f6d988 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -228,7 +228,7 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t struct page *first_page; int ret; - start_pfn = phys_index << PFN_SECTION_SHIFT; + start_pfn = section_nr_to_pfn(phys_index); first_page = pfn_to_page(start_pfn); switch (action) { diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index b82b61e..2afda10 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -502,7 +502,7 @@ int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn, end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1); for (i = start_sec; i <= end_sec; i++) { - err = __add_section(nid, zone, i << PFN_SECTION_SHIFT); + err = __add_section(nid, zone, section_nr_to_pfn(i)); /* * EEXIST is finally dealt with by ioresource collision -- 1.8.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/