* [PATCH] sysctl: Fix 'defined but not used' warning
@ 2012-10-05 15:57 Fabio Estevam
2012-10-05 18:03 ` Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2012-10-05 15:57 UTC (permalink / raw)
To: akpm; +Cc: mingo, arnd, linux-kernel, a.p.zijlstra, festevam, Fabio Estevam
Since commit 4ae834f767(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]
Annotate theses variables as '__maybe_unused'.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
kernel/sysctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index af25d0c..4bf02e4 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -256,8 +256,8 @@ 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 */
-static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
-static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
+static int __maybe_unused min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
+static int __maybe_unused max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
#endif
#ifdef CONFIG_COMPACTION
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sysctl: Fix 'defined but not used' warning
2012-10-05 15:57 [PATCH] sysctl: Fix 'defined but not used' warning Fabio Estevam
@ 2012-10-05 18:03 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2012-10-05 18:03 UTC (permalink / raw)
To: Fabio Estevam; +Cc: akpm, mingo, linux-kernel, a.p.zijlstra, festevam
On Friday 05 October 2012, Fabio Estevam wrote:
> Since commit 4ae834f767(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]
>
> Annotate theses variables as '__maybe_unused'.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
I noticed the same thing and had a different fix for it, but yours is better anyway.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-05 20:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-05 15:57 [PATCH] sysctl: Fix 'defined but not used' warning Fabio Estevam
2012-10-05 18:03 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).