2020-12-15 10:34:52

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH] arm64/smp: Remove unused irq variable in arch_show_interrupts()

arch/arm64/kernel/smp.c: In function ‘arch_show_interrupts’:
arch/arm64/kernel/smp.c:808:16: warning: unused variable ‘irq’ [-Wunused-variable]
808 | unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
| ^~~

The removal of the last user forgot to remove the variable.

Fixes: 2f516e34383d0e97 ("arm64/smp: Use irq_desc_kstat_cpu() in arch_show_interrupts()")
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
One more issue in irq-core-2020-12-14.

arch/arm64/kernel/smp.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 3aef3bc22d3250b5..10b39328268687e3 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -805,7 +805,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)
unsigned int cpu, i;

for (i = 0; i < NR_IPI; i++) {
- unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
prec >= 4 ? " " : "");
for_each_online_cpu(cpu)
--
2.25.1


2020-12-25 07:07:53

by Zenghui Yu

[permalink] [raw]
Subject: Re: [PATCH] arm64/smp: Remove unused irq variable in arch_show_interrupts()

On 2020/12/15 18:30, Geert Uytterhoeven wrote:
> arch/arm64/kernel/smp.c: In function ‘arch_show_interrupts’:
> arch/arm64/kernel/smp.c:808:16: warning: unused variable ‘irq’ [-Wunused-variable]
> 808 | unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
> | ^~~
>
> The removal of the last user forgot to remove the variable.
>
> Fixes: 2f516e34383d0e97 ("arm64/smp: Use irq_desc_kstat_cpu() in arch_show_interrupts()")

This is in mainline now and the commit id is 5089bc51f81f.

> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> One more issue in irq-core-2020-12-14.
>
> arch/arm64/kernel/smp.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 3aef3bc22d3250b5..10b39328268687e3 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -805,7 +805,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)
> unsigned int cpu, i;
>
> for (i = 0; i < NR_IPI; i++) {
> - unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
> seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
> prec >= 4 ? " " : "");
> for_each_online_cpu(cpu)

And I guess we have the same problem on 32-bit ARM. 'irq' in
show_ipi_list() is no longer used since commit 88c637748e31
("ARM: smp: Use irq_desc_kstat_cpu() in show_ipi_list()").


Thanks,
Zenghui

2021-01-04 11:51:08

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] arm64/smp: Remove unused irq variable in arch_show_interrupts()

On Tue, 15 Dec 2020 11:30:26 +0100, Geert Uytterhoeven wrote:
> arch/arm64/kernel/smp.c: In function ‘arch_show_interrupts’:
> arch/arm64/kernel/smp.c:808:16: warning: unused variable ‘irq’ [-Wunused-variable]
> 808 | unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
> | ^~~
>
> The removal of the last user forgot to remove the variable.

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64/smp: Remove unused irq variable in arch_show_interrupts()
https://git.kernel.org/arm64/c/42e85f90171a

Also adjusted the Fixes tag (before seeing that you posted a v2).

--
Catalin

2021-01-26 11:36:25

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] arm64/smp: Remove unused irq variable in arch_show_interrupts()

Hi Zenghui,

On Fri, Dec 25, 2020 at 8:05 AM Zenghui Yu <[email protected]> wrote:
> On 2020/12/15 18:30, Geert Uytterhoeven wrote:
> > arch/arm64/kernel/smp.c: In function ‘arch_show_interrupts’:
> > arch/arm64/kernel/smp.c:808:16: warning: unused variable ‘irq’ [-Wunused-variable]
> > 808 | unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
> > | ^~~
> >
> > The removal of the last user forgot to remove the variable.
> >
> > Fixes: 2f516e34383d0e97 ("arm64/smp: Use irq_desc_kstat_cpu() in arch_show_interrupts()")
>
> This is in mainline now and the commit id is 5089bc51f81f.
>
> > Signed-off-by: Geert Uytterhoeven <[email protected]>
> > ---
> > One more issue in irq-core-2020-12-14.
> >
> > arch/arm64/kernel/smp.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> > index 3aef3bc22d3250b5..10b39328268687e3 100644
> > --- a/arch/arm64/kernel/smp.c
> > +++ b/arch/arm64/kernel/smp.c
> > @@ -805,7 +805,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)
> > unsigned int cpu, i;
> >
> > for (i = 0; i < NR_IPI; i++) {
> > - unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
> > seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
> > prec >= 4 ? " " : "");
> > for_each_online_cpu(cpu)
>
> And I guess we have the same problem on 32-bit ARM. 'irq' in
> show_ipi_list() is no longer used since commit 88c637748e31
> ("ARM: smp: Use irq_desc_kstat_cpu() in show_ipi_list()").

Indeed. I didn't see it with my compiler version, but Wolfram did, and
sent a patch:
https://lore.kernel.org/linux-arm-kernel/[email protected]/

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds