[PATCH] kernel/watchdog: fix warning -Wunused-variable for watchdog_allowed_mask in ppc64

Subsystems: the rest

STALE2203d

2 messages, 2 authors, 2020-08-14 · open the first message on its own page

[PATCH] kernel/watchdog: fix warning -Wunused-variable for watchdog_allowed_mask in ppc64

From: Balamuruhan S <hidden>
Date: 2020-08-14 04:42:18

In ppc64 config if `CONFIG_SOFTLOCKUP_DETECTOR` is not set then it
warns for unused declaration of `watchdog_allowed_mask` while building,
move the declaration inside ifdef later in the code.
kernel/watchdog.c:47:23: warning: watchdog_allowed_mask defined but not used [-Wunused-variable]
 static struct cpumask watchdog_allowed_mask __read_mostly;
Signed-off-by: Balamuruhan S <redacted>
---
 kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 5abb5b22ad13..33c9b8a3d51b 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -44,7 +44,6 @@ int __read_mostly soft_watchdog_user_enabled = 1;
 int __read_mostly watchdog_thresh = 10;
 static int __read_mostly nmi_watchdog_available;
 
-static struct cpumask watchdog_allowed_mask __read_mostly;
 
 struct cpumask watchdog_cpumask __read_mostly;
 unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask);
@@ -166,6 +165,7 @@ int __read_mostly sysctl_softlockup_all_cpu_backtrace;
 unsigned int __read_mostly softlockup_panic =
 			CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE;
 
+static struct cpumask watchdog_allowed_mask __read_mostly;
 static bool softlockup_initialized __read_mostly;
 static u64 __read_mostly sample_period;
 
base-commit: a3a28c4451dff698d0c7ef5a3e80423aa5774e2b
-- 
2.24.1

Re: [PATCH] kernel/watchdog: fix warning -Wunused-variable for watchdog_allowed_mask in ppc64

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2020-08-14 13:16:46

Balamuruhan S [off-list ref] writes:
In ppc64 config if `CONFIG_SOFTLOCKUP_DETECTOR` is not set then it
warns for unused declaration of `watchdog_allowed_mask` while building,
move the declaration inside ifdef later in the code.
kernel/watchdog.c:47:23: warning: watchdog_allowed_mask defined but not used [-Wunused-variable]
 static struct cpumask watchdog_allowed_mask __read_mostly;
Signed-off-by: Balamuruhan S <redacted>
---
 kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
I don't maintain that file.

Please resend and Cc it to:

$ ./scripts/get_maintainer.pl -f kernel/watchdog.c
tglx@linutronix.de
peterz@infradead.org
Jisheng.Zhang@synaptics.com
rdna@fb.com
viro@zeniv.linux.org.uk
gpiccoli@canonical.com
pmladek@suse.com
linux-kernel@vger.kernel.org


cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help