linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Conditionally enable test_idle_cores() forward declaration
@ 2020-03-03  4:30 Anshuman Khandual
  2020-03-03  8:10 ` Vincent Guittot
  0 siblings, 1 reply; 2+ messages in thread
From: Anshuman Khandual @ 2020-03-03  4:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Anshuman Khandual, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, sfr, linux-next

test_idle_cores()'s definition and all it's call sites are enclosed within
CONFIG_SCHED_SMT. Hence the forward declaration needs to be conditionally
enabled in order to prevent build warnings like the following.

kernel/sched/fair.c:1524:20: warning: ‘test_idle_cores’ declared ‘static’
but never defined [-Wunused-function]
 static inline bool test_idle_cores(int cpu, bool def);
                    ^~~~~~~~~~~~~~~

Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ben Segall <bsegall@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: sfr@canb.auug.org.au
Cc: linux-next@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This patch solves a build problem that exists on next-20200302.

 kernel/sched/fair.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 84594f8..827087f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1521,7 +1521,9 @@ static inline bool is_core_idle(int cpu)
 }
 
 /* Forward declarations of select_idle_sibling helpers */
+#ifdef CONFIG_SCHED_SMT
 static inline bool test_idle_cores(int cpu, bool def);
+#endif
 
 struct task_numa_env {
 	struct task_struct *p;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-03  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03  4:30 [PATCH] sched/fair: Conditionally enable test_idle_cores() forward declaration Anshuman Khandual
2020-03-03  8:10 ` Vincent Guittot

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).