linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set but not used
@ 2024-04-16 10:26 Miguel Ojeda
  2024-04-16 13:51 ` David Hildenbrand
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2024-04-16 10:26 UTC (permalink / raw)
  To: david, Arnd Bergmann, Huacai Chen, WANG Xuerui
  Cc: Andrew Morton, Ryan Roberts, linux-arch, Linux-MM, linux-kernel,
	loongarch, clang-built-linux

Hi David, Arnd, LoongArch,

In a linux-next defconfig LLVM=1 build today I got:

    ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set
but not used [-Werror,-Wunused-but-set-parameter]
      629 |                 pte_t *ptep, unsigned int nr, unsigned long address)
          |                        ^

Indeed, in loongarch, `__tlb_remove_tlb_entry` does not do anything.
This seems the same that Arnd reported for arm64:

    https://lore.kernel.org/all/20240221154549.2026073-1-arnd@kernel.org/

So perhaps the loongarch's one should also be changed into an static inline?

I hope that helps!

Cheers,
Miguel


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

* Re: ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set but not used
  2024-04-16 10:26 ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set but not used Miguel Ojeda
@ 2024-04-16 13:51 ` David Hildenbrand
  2024-04-16 14:14   ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: David Hildenbrand @ 2024-04-16 13:51 UTC (permalink / raw)
  To: Miguel Ojeda, Arnd Bergmann, Huacai Chen, WANG Xuerui
  Cc: Andrew Morton, Ryan Roberts, linux-arch, Linux-MM, linux-kernel,
	loongarch, clang-built-linux

On 16.04.24 12:26, Miguel Ojeda wrote:
> Hi David, Arnd, LoongArch,
> 
> In a linux-next defconfig LLVM=1 build today I got:
> 
>      ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set
> but not used [-Werror,-Wunused-but-set-parameter]
>        629 |                 pte_t *ptep, unsigned int nr, unsigned long address)
>            |                        ^
> 
> Indeed, in loongarch, `__tlb_remove_tlb_entry` does not do anything.
> This seems the same that Arnd reported for arm64:
> 
>      https://lore.kernel.org/all/20240221154549.2026073-1-arnd@kernel.org/
> 
> So perhaps the loongarch's one should also be changed into an static inline?

4d5bf0b6183f79ea361dd506365d2a471270735c is already part of v6.9-rc1. How come
we see that only now on linux-next?

I assume we should see the same on upstream Linux with LLVM=1, correct?

If so, we should likely just drop that completely and rely on the asm-generic one:

diff --git a/arch/loongarch/include/asm/tlb.h b/arch/loongarch/include/asm/tlb.h
index da7a3b5b9374a..e071f5e9e8580 100644
--- a/arch/loongarch/include/asm/tlb.h
+++ b/arch/loongarch/include/asm/tlb.h
@@ -132,8 +132,6 @@ static __always_inline void invtlb_all(u32 op, u32 info, u64 addr)
                 );
  }
  
-#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
-
  static void tlb_flush(struct mmu_gather *tlb);
  
  #define tlb_flush tlb_flush



Thanks!

-- 
Cheers,

David / dhildenb



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

* Re: ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set but not used
  2024-04-16 13:51 ` David Hildenbrand
@ 2024-04-16 14:14   ` Arnd Bergmann
  2024-04-16 14:41     ` Huacai Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2024-04-16 14:14 UTC (permalink / raw)
  To: David Hildenbrand, Miguel Ojeda, Huacai Chen, WANG Xuerui
  Cc: Andrew Morton, Ryan Roberts, Linux-Arch, Linux-MM, linux-kernel,
	loongarch, clang-built-linux

On Tue, Apr 16, 2024, at 15:51, David Hildenbrand wrote:
> On 16.04.24 12:26, Miguel Ojeda wrote:
>> Hi David, Arnd, LoongArch,
>> 
>> In a linux-next defconfig LLVM=1 build today I got:
>> 
>>      ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set
>> but not used [-Werror,-Wunused-but-set-parameter]
>>        629 |                 pte_t *ptep, unsigned int nr, unsigned long address)
>>            |                        ^
>> 
>> Indeed, in loongarch, `__tlb_remove_tlb_entry` does not do anything.
>> This seems the same that Arnd reported for arm64:
>> 
>>      https://lore.kernel.org/all/20240221154549.2026073-1-arnd@kernel.org/
>> 
>> So perhaps the loongarch's one should also be changed into an static inline?
>
> 4d5bf0b6183f79ea361dd506365d2a471270735c is already part of v6.9-rc1. How come
> we see that only now on linux-next?

Andrew merged my patch to enable -Wextra yesterday, and it appears
that this one fell through the cracks with my testing, either I
missed the combination of loongarch with clang, or I last tested
it before your patches got merged.

> I assume we should see the same on upstream Linux with LLVM=1, correct?

On upstream, it only shows up with 'make W=1'.

> If so, we should likely just drop that completely and rely on the 
> asm-generic one:
>
> diff --git a/arch/loongarch/include/asm/tlb.h 
> b/arch/loongarch/include/asm/tlb.h
> index da7a3b5b9374a..e071f5e9e8580 100644
> --- a/arch/loongarch/include/asm/tlb.h
> +++ b/arch/loongarch/include/asm/tlb.h
> @@ -132,8 +132,6 @@ static __always_inline void invtlb_all(u32 op, u32 
> info, u64 addr)
>                  );
>   }
>  
> -#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
> -
>   static void tlb_flush(struct mmu_gather *tlb);

Yes, this looks like the best solution, and I can confirm that this
addresses the warning on linux-next.

Tested-by: Arnd Bergmann <arnd@arndb.de>


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

* Re: ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set but not used
  2024-04-16 14:14   ` Arnd Bergmann
@ 2024-04-16 14:41     ` Huacai Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Huacai Chen @ 2024-04-16 14:41 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David Hildenbrand, Miguel Ojeda, WANG Xuerui, Andrew Morton,
	Ryan Roberts, Linux-Arch, Linux-MM, linux-kernel, loongarch,
	clang-built-linux

On Tue, Apr 16, 2024 at 10:14 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Tue, Apr 16, 2024, at 15:51, David Hildenbrand wrote:
> > On 16.04.24 12:26, Miguel Ojeda wrote:
> >> Hi David, Arnd, LoongArch,
> >>
> >> In a linux-next defconfig LLVM=1 build today I got:
> >>
> >>      ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set
> >> but not used [-Werror,-Wunused-but-set-parameter]
> >>        629 |                 pte_t *ptep, unsigned int nr, unsigned long address)
> >>            |                        ^
> >>
> >> Indeed, in loongarch, `__tlb_remove_tlb_entry` does not do anything.
> >> This seems the same that Arnd reported for arm64:
> >>
> >>      https://lore.kernel.org/all/20240221154549.2026073-1-arnd@kernel.org/
> >>
> >> So perhaps the loongarch's one should also be changed into an static inline?
> >
> > 4d5bf0b6183f79ea361dd506365d2a471270735c is already part of v6.9-rc1. How come
> > we see that only now on linux-next?
>
> Andrew merged my patch to enable -Wextra yesterday, and it appears
> that this one fell through the cracks with my testing, either I
> missed the combination of loongarch with clang, or I last tested
> it before your patches got merged.
>
> > I assume we should see the same on upstream Linux with LLVM=1, correct?
>
> On upstream, it only shows up with 'make W=1'.
>
> > If so, we should likely just drop that completely and rely on the
> > asm-generic one:
> >
> > diff --git a/arch/loongarch/include/asm/tlb.h
> > b/arch/loongarch/include/asm/tlb.h
> > index da7a3b5b9374a..e071f5e9e8580 100644
> > --- a/arch/loongarch/include/asm/tlb.h
> > +++ b/arch/loongarch/include/asm/tlb.h
> > @@ -132,8 +132,6 @@ static __always_inline void invtlb_all(u32 op, u32
> > info, u64 addr)
> >                  );
> >   }
> >
> > -#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
> > -
> >   static void tlb_flush(struct mmu_gather *tlb);
>
> Yes, this looks like the best solution, and I can confirm that this
> addresses the warning on linux-next.
Emmm, this should be removed in the first place because x86 removed it
at 5.12...

Huacai
>
> Tested-by: Arnd Bergmann <arnd@arndb.de>


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

end of thread, other threads:[~2024-04-16 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16 10:26 ./include/asm-generic/tlb.h:629:10: error: parameter 'ptep' set but not used Miguel Ojeda
2024-04-16 13:51 ` David Hildenbrand
2024-04-16 14:14   ` Arnd Bergmann
2024-04-16 14:41     ` Huacai Chen

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