linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/mmu_gather: change __tlb_remove_tlb_entry() to an inline function
@ 2024-02-21 15:45 Arnd Bergmann
  2024-02-21 19:30 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-02-21 15:45 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand
  Cc: Arnd Bergmann, Will Deacon, Aneesh Kumar K.V, Nick Piggin,
	Peter Zijlstra, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Justin Stitt, Ryan Roberts, Vishal Moola (Oracle),
	Alistair Popple, linux-arch, linux-mm, linux-kernel, llvm

From: Arnd Bergmann <arnd@arndb.de>

clang complains about tlb_remove_tlb_entries() not using the 'ptep' variable
when __tlb_remove_tlb_entry() is an empty macro:

include/asm-generic/tlb.h:627:10: error: parameter 'ptep' set but not used [-Werror,-Wunused-but-set-parameter]

Change it to an equivalent inline function that avoids the warning since
the compiler can see how the variable gets passed into it.

Fixes: 66958b447695 ("mm/mmu_gather: add tlb_remove_tlb_entries()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/asm-generic/tlb.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index bd00dd238b79..709830274b75 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -600,7 +600,9 @@ static inline void tlb_flush_p4d_range(struct mmu_gather *tlb,
 }
 
 #ifndef __tlb_remove_tlb_entry
-#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
+static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long address)
+{
+}
 #endif
 
 /**
-- 
2.39.2



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

* Re: [PATCH] mm/mmu_gather: change __tlb_remove_tlb_entry() to an inline function
  2024-02-21 15:45 [PATCH] mm/mmu_gather: change __tlb_remove_tlb_entry() to an inline function Arnd Bergmann
@ 2024-02-21 19:30 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2024-02-21 19:30 UTC (permalink / raw)
  To: Arnd Bergmann, Andrew Morton
  Cc: Arnd Bergmann, Will Deacon, Aneesh Kumar K.V, Nick Piggin,
	Peter Zijlstra, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Justin Stitt, Ryan Roberts, Vishal Moola (Oracle),
	Alistair Popple, linux-arch, linux-mm, linux-kernel, llvm

On 21.02.24 16:45, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 

Hi Arnd,

> clang complains about tlb_remove_tlb_entries() not using the 'ptep' variable
> when __tlb_remove_tlb_entry() is an empty macro:
> 
> include/asm-generic/tlb.h:627:10: error: parameter 'ptep' set but not used [-Werror,-Wunused-but-set-parameter]
> 
> Change it to an equivalent inline function that avoids the warning since
> the compiler can see how the variable gets passed into it.
> 

Ugh, quite an annoying clang behavior in this particular case. I wonder 
why no build bot complained so far.

Thanks!

> Fixes: 66958b447695 ("mm/mmu_gather: add tlb_remove_tlb_entries()")

That commit id is not stable yet. So Andrew might want to fold it into 
that commit before moving it to mm-stable.


-- 
Cheers,

David / dhildenb



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

end of thread, other threads:[~2024-02-21 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-21 15:45 [PATCH] mm/mmu_gather: change __tlb_remove_tlb_entry() to an inline function Arnd Bergmann
2024-02-21 19:30 ` David Hildenbrand

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