Message ID | 20200814133330.210093-1-bala24@linux.ibm.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show |
Series | kernel/watchdog: fix warning -Wunused-variable for watchdog_allowed_mask in ppc64 | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch powerpc/merge (f04b169e953c4db1a3a3c1d23eea09c726f01ee5) |
snowpatch_ozlabs/build-ppc64le | warning | Upstream build failed, couldn't test patch |
snowpatch_ozlabs/build-ppc64be | warning | Upstream build failed, couldn't test patch |
snowpatch_ozlabs/build-ppc64e | warning | Upstream build failed, couldn't test patch |
snowpatch_ozlabs/build-pmac32 | warning | Upstream build failed, couldn't test patch |
snowpatch_ozlabs/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 14 lines checked |
snowpatch_ozlabs/needsstable | success | Patch has no Fixes tags |
On Fri 2020-08-14 19:03:30, Balamuruhan S wrote: > 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 <bala24@linux.ibm.com> > --- > 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; 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. Reviewed-by: Petr Mladek <pmladek@suse.com> Best Regards, Petr
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;
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 <bala24@linux.ibm.com> --- kernel/watchdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: a3a28c4451dff698d0c7ef5a3e80423aa5774e2b