kernel/watchdog: fix warning -Wunused-variable for watchdog_allowed_mask in ppc64
PATCH 1/1 kernel/watchdog: fix warning -Wunused-variable for watchdog_allowed_mask in ppc64
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; ```
--- kernel/watchdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/watchdog.c +1 -1
@@ -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
Signature · 1 line
2.24.1
Quoted 27 lines · Balamuruhan S
In ppc64 config if
CONFIG_SOFTLOCKUP_DETECTORis not set then it warns for unused declaration ofwatchdog_allowed_maskwhile 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 <[email protected]>--- kernel/watchdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/watchdog.c +0
-1@@ -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);
kernel/watchdog.c int __read_mostly sysctl_softlockup_all_cpu_backtrace; · line 168
Quoted 4 lines
kernel/watchdog.c +1
-0@@ -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 ;
I could confirm that the variable is used only in code that is built when CONFIG_SOFTLOCKUP_DETECTOR is enabled.
Note that the problem can't be seen on x86. There the softlockup detector is enforced together with hardloclup detector via via HARDLOCKUP_DETECTOR_PERF.
Best Regards,
Petr