From patchwork Fri Dec 2 19:22:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 9459037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 15C976074E for ; Fri, 2 Dec 2016 19:22:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3AF3284D9 for ; Fri, 2 Dec 2016 19:22:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E866828579; Fri, 2 Dec 2016 19:22:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A74A284D9 for ; Fri, 2 Dec 2016 19:22:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8B3E981F5E; Fri, 2 Dec 2016 11:22:29 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mailrelay112.isp.belgacom.be (mailrelay112.isp.belgacom.be [195.238.20.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9B1CF81F5C for ; Fri, 2 Dec 2016 11:22:28 -0800 (PST) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AGAwDByEFY/9JLtVtcHgYMgzgBAQEBA?= =?us-ascii?q?R+BYKR3AZJGgg+CBoYighxAFAECAQEBAQEBAWIohRYvI09LJBOIc64DPYtfhj6?= =?us-ascii?q?PBQWaY5EUApA3SZFEHzeBGYMKAVEcgV49NIh+AQEB?= X-IPAS-Result: =?us-ascii?q?A2AGAwDByEFY/9JLtVtcHgYMgzgBAQEBAR+BYKR3AZJGgg+?= =?us-ascii?q?CBoYighxAFAECAQEBAQEBAWIohRYvI09LJBOIc64DPYtfhj6PBQWaY5EUApA3S?= =?us-ascii?q?ZFEHzeBGYMKAVEcgV49NIh+AQEB?= Received: from 210.75-181-91.adsl-dyn.isp.belgacom.be (HELO inkjet2.lan) ([91.181.75.210]) by relay.skynet.be with ESMTP; 02 Dec 2016 20:22:26 +0100 From: Fabian Frederick To: Dan Williams Subject: [PATCH 8/8 linux-next] mm: use SECTION_MASK where possible Date: Fri, 2 Dec 2016 20:22:20 +0100 Message-Id: <1480706540-21323-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.7.4 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabf@skynet.be, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Fabian Frederick --- kernel/memremap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/memremap.c b/kernel/memremap.c index 1bb5eec..8ebf9dd 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -198,7 +198,7 @@ static void pgmap_radix_release(struct resource *res) { resource_size_t key, align_start, align_size, align_end; - align_start = res->start & ~(SECTION_SIZE - 1); + align_start = res->start & SECTION_MASK; align_size = ALIGN(resource_size(res), SECTION_SIZE); align_end = align_start + align_size - 1; @@ -244,7 +244,7 @@ static void devm_memremap_pages_release(struct device *dev, void *data) } /* pages are dead and unused, undo the arch mapping */ - align_start = res->start & ~(SECTION_SIZE - 1); + align_start = res->start & SECTION_MASK; align_size = ALIGN(resource_size(res), SECTION_SIZE); arch_remove_memory(align_start, align_size); untrack_pfn(NULL, PHYS_PFN(align_start), align_size); @@ -289,7 +289,7 @@ void *devm_memremap_pages(struct device *dev, struct resource *res, int error, nid, is_ram; unsigned long pfn; - align_start = res->start & ~(SECTION_SIZE - 1); + align_start = res->start & SECTION_MASK; align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE) - align_start; is_ram = region_intersects(align_start, align_size,