Skip to content

Commit afa70d9

Browse files
vireshkIngo Molnar
authored andcommitted
sched/fair: Define sched_idle_cpu() only for SMP configurations
sched_idle_cpu() isn't used for non SMP configuration and with a recent change, we have started getting following warning: kernel/sched/fair.c:5221:12: warning: ‘sched_idle_cpu’ defined but not used [-Wunused-function] Fix that by defining sched_idle_cpu() only for SMP configurations. Fixes: 323af6d ("sched/fair: Load balance aggressively for SCHED_IDLE CPUs") Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Vincent Guittot <[email protected]> Cc: Dietmar Eggemann <[email protected]> Link: https://lore.kernel.org/r/f0554f590687478b33914a4aff9f0e6a62886d44.1579499907.git.viresh.kumar@linaro.org
1 parent ccf7412 commit afa70d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/sched/fair.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5218,10 +5218,12 @@ static int sched_idle_rq(struct rq *rq)
52185218
rq->nr_running);
52195219
}
52205220

5221+
#ifdef CONFIG_SMP
52215222
static int sched_idle_cpu(int cpu)
52225223
{
52235224
return sched_idle_rq(cpu_rq(cpu));
52245225
}
5226+
#endif
52255227

52265228
/*
52275229
* The enqueue_task method is called before nr_running is

0 commit comments

Comments
 (0)