summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorQian Cai <cai@lca.pw>2019-07-31 16:05:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-25 10:47:56 +0200
commit4a0d2eeea27a868c7a3288fe96607580f27ed84e (patch)
tree1bd238bacf9eee312e84337ace9ae054f0a4fdb3 /arch
parent6af9263f685d8ae3fc93ba8a19eb586e5d387b23 (diff)
downloadlinux-stable-4a0d2eeea27a868c7a3288fe96607580f27ed84e.tar.gz
linux-stable-4a0d2eeea27a868c7a3288fe96607580f27ed84e.tar.bz2
linux-stable-4a0d2eeea27a868c7a3288fe96607580f27ed84e.zip
arm64/mm: fix variable 'pud' set but not used
[ 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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/include/asm/pgtable.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index ea423db39364..2214a403f39b 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -419,8 +419,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)