2024-04-16 15:18:34

by David Hildenbrand

[permalink] [raw]
Subject: [PATCH v1] LoongArch/tlb: fix "error: parameter 'ptep' set but not used" due to __tlb_remove_tlb_entry()

With LLVM=1 and W=1 we get:

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

We fixed a similar issue via Arnd in the introducing commit, missed the
loongarch variant. Turns out, there is no need for loongarch to have a
custom variant, so let's just drop it and rely on the asm-generic one.

Reported-by: Miguel Ojeda <[email protected]>
Closes: https://lkml.kernel.org/r/CANiq72mQh3O9S4umbvrKBgMMorty48UMwS01U22FR0mRyd3cyQ@mail.gmail.com
Fixes: 4d5bf0b6183f ("mm/mmu_gather: add tlb_remove_tlb_entries()")
Tested-by: Arnd Bergmann <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
---
arch/loongarch/include/asm/tlb.h | 2 --
1 file changed, 2 deletions(-)

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
--
2.44.0



2024-04-16 19:25:12

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH v1] LoongArch/tlb: fix "error: parameter 'ptep' set but not used" due to __tlb_remove_tlb_entry()

On Tue, Apr 16, 2024 at 4:49 PM David Hildenbrand <[email protected]> wrote:
>
> With LLVM=1 and W=1 we get:

Hmm... I didn't need W=1 to trigger it (LLVM 18.1.2).

> Reported-by: Miguel Ojeda <[email protected]>

Thanks, looks good to me -- built-tested:

Reviewed-by: Miguel Ojeda <[email protected]>
Tested-by: Miguel Ojeda <[email protected]>

Cheers,
Miguel

2024-04-17 03:21:44

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH v1] LoongArch/tlb: fix "error: parameter 'ptep' set but not used" due to __tlb_remove_tlb_entry()

Queued for loongarch-fixes, thanks.

Huacai

On Wed, Apr 17, 2024 at 3:25 AM Miguel Ojeda
<[email protected]> wrote:
>
> On Tue, Apr 16, 2024 at 4:49 PM David Hildenbrand <[email protected]> wrote:
> >
> > With LLVM=1 and W=1 we get:
>
> Hmm... I didn't need W=1 to trigger it (LLVM 18.1.2).
>
> > Reported-by: Miguel Ojeda <[email protected]>
>
> Thanks, looks good to me -- built-tested:
>
> Reviewed-by: Miguel Ojeda <[email protected]>
> Tested-by: Miguel Ojeda <[email protected]>
>
> Cheers,
> Miguel

2024-04-17 21:00:54

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH v1] LoongArch/tlb: fix "error: parameter 'ptep' set but not used" due to __tlb_remove_tlb_entry()

On Wed, 17 Apr 2024 11:18:27 +0800 Huacai Chen <[email protected]> wrote:

> On Wed, Apr 17, 2024 at 3:25 AM Miguel Ojeda
> <[email protected]> wrote:
> >
> > On Tue, Apr 16, 2024 at 4:49 PM David Hildenbrand <[email protected]> wrote:
> > >
> > > With LLVM=1 and W=1 we get:
> >
> > Hmm... I didn't need W=1 to trigger it (LLVM 18.1.2).
> >
> > > Reported-by: Miguel Ojeda <[email protected]>
> >
> > Thanks, looks good to me -- built-tested:
> >
> > Reviewed-by: Miguel Ojeda <[email protected]>
> > Tested-by: Miguel Ojeda <[email protected]>
> >
>
> Queued for loongarch-fixes, thanks.
>

(top-posting repaired so I can sensibly reply to this. Please avoid
top-posting!)

I'd rather carry this in mm.git with your ack please. Otherwise mm.git
won't compile without it and if I retain this patch we'll get
duplicate-patch emails from Stephen and I won't be able to merge
mm.git's mm-nonmm-stable tree into Linus until loongarch-fixes has
merged.


2024-04-18 03:03:49

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH v1] LoongArch/tlb: fix "error: parameter 'ptep' set but not used" due to __tlb_remove_tlb_entry()

Hi, Andrew,

On Thu, Apr 18, 2024 at 4:58 AM Andrew Morton <[email protected]> wrote:
>
> On Wed, 17 Apr 2024 11:18:27 +0800 Huacai Chen <[email protected]> wrote:
>
> > On Wed, Apr 17, 2024 at 3:25 AM Miguel Ojeda
> > <[email protected]> wrote:
> > >
> > > On Tue, Apr 16, 2024 at 4:49 PM David Hildenbrand <[email protected]> wrote:
> > > >
> > > > With LLVM=1 and W=1 we get:
> > >
> > > Hmm... I didn't need W=1 to trigger it (LLVM 18.1.2).
> > >
> > > > Reported-by: Miguel Ojeda <[email protected]>
> > >
> > > Thanks, looks good to me -- built-tested:
> > >
> > > Reviewed-by: Miguel Ojeda <[email protected]>
> > > Tested-by: Miguel Ojeda <[email protected]>
> > >
> >
> > Queued for loongarch-fixes, thanks.
> >
>
> (top-posting repaired so I can sensibly reply to this. Please avoid
> top-posting!)
Sorry, I only top-posting with "Queued ...", "Applied ..." because I
saw others do like this. If this is also unacceptable, I will not do
it again.

>
> I'd rather carry this in mm.git with your ack please. Otherwise mm.git
> won't compile without it and if I retain this patch we'll get
> duplicate-patch emails from Stephen and I won't be able to merge
> mm.git's mm-nonmm-stable tree into Linus until loongarch-fixes has
> merged.
loongarch-next always merges loongarch-fixes, so when I apply a patch
it will be in linux-next. Now this patch I have already applied to
loongarch-fixes and loongarch-next. In future, I will give an Acked-by
for you if needed.

Huacai

>
>