Skip to contentSkip to conversation

kernel/watchdog: hide unused function

PATCH In review Arnd Bergmann 2 participants 2 messages Jun 20, 2017 – Jun 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/watchdog: hide unused function

watchdog_update_cpus() is defined unconditionally, but only used when CONFIG_SYSCTL is defined:

kernel/watchdog.c:608:12: error: 'watchdog_update_cpus' defined but not used [-Werror=unused-function]

This adds another #ifdef around it.

Fixes mmotm ("kernel/watchdog: provide watchdog_nmi_reconfigure() for arch watchdogs")
---
 kernel/watchdog.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/watchdog.c +4 -0
index 06cd965f64d2..95361f9f3f40 100644
@@ -605,11 +605,13 @@ static void watchdog_disable_all_cpus(void)
 	}
 }
 
+#ifdef CONFIG_SYSCTL
 static int watchdog_update_cpus(void)
 {
 	return smpboot_update_cpumask_percpu_thread(
 		    &watchdog_threads, &watchdog_cpumask);
 }
+#endif
 
 #else /* SOFTLOCKUP */
 static int watchdog_park_threads(void)
@@ -630,10 +632,12 @@ static void watchdog_disable_all_cpus(void)
 {
 }
 
+#ifdef CONFIG_SYSCTL
 static int watchdog_update_cpus(void)
 {
 	return 0;
 }
+#endif
 
 static void set_sample_period(void)
 {
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Arnd Bergmann

watchdog_update_cpus() is defined unconditionally, but only used when CONFIG_SYSCTL is defined:

kernel/watchdog.c:608:12: error: 'watchdog_update_cpus' defined but not used [-Werror=unused-function]

This adds another #ifdef around it.

Thanks!

Quoted 41 lines
Fixes mmotm ("kernel/watchdog: provide watchdog_nmi_reconfigure() for arch watchdogs")
---
 kernel/watchdog.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/watchdog.c +4 -0
index 06cd965f64d2..95361f9f3f40 100644
@@ -605,11 +605,13 @@ static void watchdog_disable_all_cpus(void)
 	}
 }
 
+#ifdef CONFIG_SYSCTL
 static int watchdog_update_cpus(void)
 {
 	return smpboot_update_cpumask_percpu_thread(
 		    &watchdog_threads, &watchdog_cpumask);
 }
+#endif
 
 #else /* SOFTLOCKUP */
 static int watchdog_park_threads(void)
@@ -630,10 +632,12 @@ static void watchdog_disable_all_cpus(void)
 {
 }
 
+#ifdef CONFIG_SYSCTL
 static int watchdog_update_cpus(void)
 {
 	return 0;
 }
+#endif
 
 static void set_sample_period(void)
 {
Signature · 1 line
2.9.0