Skip to contentSkip to conversation

sysctl/sched: Fix 'defined but not used' warning

tip:numa/core tip-bot for Peter Zijlstra 1 participant 1 message Oct 24, 2012 Proc sysctl

lore
Share & tools
lore
#0 lore raw
Commit-ID:  f7d07c71748f040a1dc85943245931925b80892f
Gitweb:     http://git.kernel.org/tip/f7d07c71748f040a1dc85943245931925b80892f
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Tue, 23 Oct 2012 17:47:12 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 24 Oct 2012 10:19:07 +0200

sysctl/sched: Fix 'defined but not used' warning

Since commit ("sched/numa: Implement NUMA home-node selection code") building a kernel with CONFIG_SMP disabled causes the following warning:

kernel/sysctl.c:259:12: warning: 'min_sched_tunable_scaling' defined but not used [-Wunused-variable] kernel/sysctl.c:260:12: warning: 'max_sched_tunable_scaling' defined but not used [-Wunused-variable]

[ Ingo preferred extra #ifdef variant over the __maybe_unused ]
---
 kernel/sysctl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
kernel/sysctl.c +3 -1
index 2f7e671..b769d25 100644
@@ -256,9 +256,11 @@ static int min_sched_granularity_ns = 100000;		/* 100 usecs */
 static int max_sched_granularity_ns = NSEC_PER_SEC;	/* 1 second */
 static int min_wakeup_granularity_ns;			/* 0 usecs */
 static int max_wakeup_granularity_ns = NSEC_PER_SEC;	/* 1 second */
+#ifdef CONFIG_SMP
 static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
 static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
-#endif
+#endif /* CONFIG_SMP */
+#endif /* CONFIG_SCHED_DEBUG */
 
 #ifdef CONFIG_COMPACTION
 static int min_extfrag_threshold;