mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: fix pte_unmap() -Wunused-but-set-variable
@ 2019-04-29 17:37 Qian Cai
  2019-04-29 17:37 ` [PATCH 2/2] arm64: remove pte_unmap_nested() Qian Cai
  0 siblings, 1 reply; 2+ messages in thread
From: Qian Cai @ 2019-04-29 17:37 UTC (permalink / raw)
  To: catalin.marinas, will.deacon; +Cc: linux-arm-kernel, linux-kernel, Qian Cai

Many compilation warnings due to pte_unmap() compiles away. Fixed it by
making it an static inline function.

mm/gup.c: In function 'gup_pte_range':
mm/gup.c:1727:16: warning: variable 'ptem' set but not used
[-Wunused-but-set-variable]
mm/gup.c: At top level:
mm/memory.c: In function 'copy_pte_range':
mm/memory.c:821:24: warning: variable 'orig_dst_pte' set but not used
[-Wunused-but-set-variable]
mm/memory.c:821:9: warning: variable 'orig_src_pte' set but not used
[-Wunused-but-set-variable]
mm/swap_state.c: In function 'swap_ra_info':
mm/swap_state.c:641:15: warning: variable 'orig_pte' set but not used
[-Wunused-but-set-variable]
mm/madvise.c: In function 'madvise_free_pte_range':
mm/madvise.c:318:9: warning: variable 'orig_pte' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Qian Cai <cai@lca.pw>
---
 arch/arm64/include/asm/pgtable.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index de70c1eabf33..74ebe9693714 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -478,6 +478,8 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd)
 	return __pmd_to_phys(pmd);
 }
 
+static inline void pte_unmap(pte_t *pte) { }
+
 /* Find an entry in the third-level page table. */
 #define pte_index(addr)		(((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
 
@@ -486,7 +488,6 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd)
 
 #define pte_offset_map(dir,addr)	pte_offset_kernel((dir), (addr))
 #define pte_offset_map_nested(dir,addr)	pte_offset_kernel((dir), (addr))
-#define pte_unmap(pte)			do { } while (0)
 #define pte_unmap_nested(pte)		do { } while (0)
 
 #define pte_set_fixmap(addr)		((pte_t *)set_fixmap_offset(FIX_PTE, addr))
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-29 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 17:37 [PATCH 1/2] arm64: fix pte_unmap() -Wunused-but-set-variable Qian Cai
2019-04-29 17:37 ` [PATCH 2/2] arm64: remove pte_unmap_nested() Qian Cai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®