From patchwork Wed Feb 11 22:06:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 5814661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50DE6BF440 for ; Wed, 11 Feb 2015 22:09:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7363A20148 for ; Wed, 11 Feb 2015 22:09:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 972672012E for ; Wed, 11 Feb 2015 22:09:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLfQg-0008Hv-Et; Wed, 11 Feb 2015 22:06:42 +0000 Received: from mail.linuxfoundation.org ([140.211.169.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLfQd-0008DO-On for linux-arm-kernel@lists.infradead.org; Wed, 11 Feb 2015 22:06:40 +0000 Received: from akpm3.mtv.corp.google.com (unknown [216.239.45.95]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8D4ECAFB; Wed, 11 Feb 2015 22:06:18 +0000 (UTC) Date: Wed, 11 Feb 2015 14:06:17 -0800 From: Andrew Morton To: Russell King - ARM Linux Subject: Re: [PATCH] arm/mm: fix compiler warning in pmdp_invalidate() (in -next) Message-Id: <20150211140617.9f00465d147fe0db10777dfb@linux-foundation.org> In-Reply-To: <20150130164015.GQ26493@n2100.arm.linux.org.uk> References: <20150130100620.GL2395@suse.de> <1422635852-21569-1-git-send-email-andre.przywara@arm.com> <20150130164015.GQ26493@n2100.arm.linux.org.uk> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150211_140639_834664_5B9E58C9 X-CRM114-Status: GOOD ( 21.57 ) X-Spam-Score: -2.3 (--) Cc: linux-arm-kernel@lists.infradead.org, Andre Przywara , Mel Gorman , linux-kernel@vger.kernel.org, catalin.marinas@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 30 Jan 2015 16:40:15 +0000 Russell King - ARM Linux wrote: > On Fri, Jan 30, 2015 at 04:37:32PM +0000, Andre Przywara wrote: > > Commit ff61d185f4e7 ("mm: convert p[te|md]_mknonnuma and remaining > > page table manipulations") removed a check in > > mm/pgtable-generic.c:pmdp_invalidate(), which leaves the > > pmd_mknotpresent macro the only user of the entry variable. > > For ARM/LPAE we use a constant 0 without referencing the argument to > > mark this condition, so the entry variable is no longer used here: > > > > mm/pgtable-generic.c: In function 'pmdp_invalidate': > > mm/pgtable-generic.c:195:8: warning: unused variable 'entry' [-Wunused-variable] > > pmd_t entry = *pmdp; > > ^ > > > > Replace the ARM macro implementation with a static inline function to > > get rid of this warning. > > > > Signed-off-by: Andre Przywara > > --- > > Hi Andrew, > > > > Mel mentioned that I should send that simple fix below to you to > > merge it with his original mmotm patch: > > mm-convert-p_mknonnuma-and-remaining-page-table-manipulations.patch > > The commit message above contains the mmotm-reference to this patch, > > which will break when it hits mainline. > > > > Can you consider this? Given that's only a warning fix I am also > > happy with resending it after -rc1, if you reckon that this arch/arm > > change should not go via mmotm. > > This isn't correct though. > > > /* represent a notpresent pmd by zero, this is used by pmdp_invalidate */ > > -#define pmd_mknotpresent(pmd) (__pmd(0)) > > +static inline pmd_t pmd_mknotpresent(pmd_t pmd) > > +{ > > + return 0; > > +} > > typedef struct { pmdval_t pmd; } pmd_t; > > typedef u32 pmdval_t; > > "0" is not compatible with pmd_t when STRICT_MM_TYPECHECKS is enabled. This? --- a/arch/arm/include/asm/pgtable-3level.h~mm-convert-p_mknonnuma-and-remaining-page-table-manipulations-fix-fix +++ a/arch/arm/include/asm/pgtable-3level.h @@ -259,7 +259,7 @@ PMD_BIT_FUNC(mkyoung, |= PMD_SECT_AF); /* represent a notpresent pmd by zero, this is used by pmdp_invalidate */ static inline pmd_t pmd_mknotpresent(pmd_t pmd) { - return 0; + return __pmd(0); } static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)