linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Qian Cai <cai@lca.pw>, Will Deacon <will@kernel.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.9 12/17] arm64/mm: fix variable 'pud' set but not used
Date: Tue,  6 Aug 2019 17:37:09 -0400	[thread overview]
Message-ID: <20190806213715.20487-12-sashal@kernel.org> (raw)
In-Reply-To: <20190806213715.20487-1-sashal@kernel.org>

From: Qian Cai <cai@lca.pw>

[ Upstream commit 7d4e2dcf311d3b98421d1f119efe5964cafa32fc ]

GCC throws a warning,

arch/arm64/mm/mmu.c: In function 'pud_free_pmd_page':
arch/arm64/mm/mmu.c:1033:8: warning: variable 'pud' set but not used
[-Wunused-but-set-variable]
  pud_t pud;
        ^~~

because pud_table() is a macro and compiled away. Fix it by making it a
static inline function and for pud_sect() as well.

Signed-off-by: Qian Cai <cai@lca.pw>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/include/asm/pgtable.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 73e3718356b05..edb2c359480db 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -387,8 +387,8 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 				 PMD_TYPE_SECT)
 
 #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
-#define pud_sect(pud)		(0)
-#define pud_table(pud)		(1)
+static inline bool pud_sect(pud_t pud) { return false; }
+static inline bool pud_table(pud_t pud) { return true; }
 #else
 #define pud_sect(pud)		((pud_val(pud) & PUD_TYPE_MASK) == \
 				 PUD_TYPE_SECT)
-- 
2.20.1


  parent reply	other threads:[~2019-08-06 21:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 21:36 [PATCH AUTOSEL 4.9 01/17] xtensa: fix build for cores with coprocessors Sasha Levin
2019-08-06 21:36 ` [PATCH AUTOSEL 4.9 02/17] xen/pciback: remove set but not used variable 'old_state' Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 03/17] irqchip/irq-imx-gpcv2: Forward irq type to parent Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 04/17] perf header: Fix divide by zero error if f_header.attr_size==0 Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 05/17] perf header: Fix use of unitialized value warning Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 06/17] libata: zpodd: Fix small read overflow in zpodd_get_mech_type() Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 07/17] scsi: hpsa: correct scsi command status issue after reset Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 08/17] exit: make setting exit_state consistent Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 09/17] ata: libahci: do not complain in case of deferred probe Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 10/17] kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 11/17] arm64/efi: fix variable 'si' set but not used Sasha Levin
2019-08-06 21:37 ` Sasha Levin [this message]
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 13/17] IB/core: Add mitigation for Spectre V1 Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 14/17] IB/mad: Fix use-after-free in ib mad completion handling Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 15/17] ocfs2: remove set but not used variable 'last_hash' Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 16/17] coredump: split pipe command whitespace before expanding template Sasha Levin
2019-08-06 21:37 ` [PATCH AUTOSEL 4.9 17/17] asm-generic: fix -Wtype-limits compiler warnings Sasha Levin

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=20190806213715.20487-12-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=cai@lca.pw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).