Skip to contentSkip to conversation

sh: kernel: traps: remove unused variable

PATCH In review Anders Roxell 3 participants 3 messages Dec 10, 2020 – Jan 18, 2021 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: kernel: traps: remove unused variable

When building defconfig the following warning shows up:

arch/sh/kernel/traps.c: In function 'nmi_trap_handler':
arch/sh/kernel/traps.c:183:15: warning: unused variable 'cpu' [-Wunused-variable]

  unsigned int cpu = smp_processor_id();
               ^~~

Remove an unused variable 'cpu'.

Fixes fe3f1d5d7cd3 ("sh: Get rid of nmi_count()")
---
 arch/sh/kernel/traps.c | 1 -
 1 file changed, 1 deletion(-)
arch/sh/kernel/traps.c +0 -1
index f5beecdac693..e76b22157099 100644
@@ -180,7 +180,6 @@ static inline void arch_ftrace_nmi_exit(void) { }
 
 BUILD_TRAP_HANDLER(nmi)
 {
-	unsigned int cpu = smp_processor_id();
 	TRAP_HANDLER_DECL;
 
 	arch_ftrace_nmi_enter();
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Anders Roxell

When building defconfig the following warning shows up:

arch/sh/kernel/traps.c: In function 'nmi_trap_handler':
arch/sh/kernel/traps.c:183:15: warning: unused variable 'cpu' [-Wunused-variable]

  unsigned int cpu = smp_processor_id();
               ^~~

Remove an unused variable 'cpu'.

Fixes fe3f1d5d7cd3 ("sh: Get rid of nmi_count()")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
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
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Anders Roxell
Quoted 20 lines · Anders Roxell

When building defconfig the following warning shows up:

arch/sh/kernel/traps.c: In function 'nmi_trap_handler':
arch/sh/kernel/traps.c:183:15: warning: unused variable 'cpu' [-Wunused-variable]

  unsigned int cpu = smp_processor_id();
               ^~~

Remove an unused variable 'cpu'.

Fixes fe3f1d5d7cd3 ("sh: Get rid of nmi_count()")
---
 arch/sh/kernel/traps.c | 1 -
 1 file changed, 1 deletion(-)
arch/sh/kernel/traps.c +0 -0
index f5beecdac693..e76b22157099 100644

arch/sh/kernel/traps.c static inline void arch_ftrace_nmi_exit(void) { } · line 185

Quoted 7 lines
arch/sh/kernel/traps.c +0 -1
@@ -180,7 +180,6 @@ static inline void arch_ftrace_nmi_exit(void) { }
 
 BUILD_TRAP_HANDLER(nmi)
 {
-	unsigned int cpu = smp_processor_id();
 	TRAP_HANDLER_DECL;
 
 	arch_ftrace_nmi_enter();

Good catch. Now I have one warning less when building the kernel for my SH-7785LCR ;-).

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913