Skip to contentSkip to conversation

sched/fair: fix build warning about undefined test_idle_cores()

PATCH In review [email protected] 2 participants 2 messages Mar 8, 2020 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: fix build warning about undefined test_idle_cores()

From: chenqiwu <[email protected]>

The build with arm64's defconfig:
CONFIG_SCHED_MC=y
# CONFIG_SCHED_SMT is not set

Trigger the following warning due to test_idle_cores()'s definition missing:
kernel/sched/fair.c:1524:20: warning: ‘test_idle_cores’ declared ‘static’
but never defined [-Wunused-function]

Move the CONFIG_SCHED_SMT ifdeffery around test_idle_cores()'s declaration to fix it.

---
 kernel/sched/fair.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/sched/fair.c +2 -0
index 84594f8..d11d965 100644
@@ -1520,8 +1520,10 @@ static inline bool is_core_idle(int cpu)
 	return true;
 }
 
+#ifdef CONFIG_SCHED_SMT
 /* Forward declarations of select_idle_sibling helpers */
 static inline bool test_idle_cores(int cpu, bool def);
+#endif
 
 struct task_numa_env {
 	struct task_struct *p;
Signature · 1 line
1.9.1
reviewer
#1 lore raw
Quoted 11 lines · On Sun, Mar 08, 2020 at 11:53:12PM +0800, [email protected] wrote:

From: chenqiwu <[email protected]>

The build with arm64's defconfig:
CONFIG_SCHED_MC=y
# CONFIG_SCHED_SMT is not set

Trigger the following warning due to test_idle_cores()'s definition missing:
kernel/sched/fair.c:1524:20: warning: ???test_idle_cores??? declared ???static???
but never defined [-Wunused-function]

Quoted 4 lines

Move the CONFIG_SCHED_SMT ifdeffery around test_idle_cores()'s declaration to fix it.

Thanks. A fix has been merged to tip/sched/core as

commit 76c389ab2b5e300698eab87f9d4b7916f14117ba

Author: Valentin Schneider <[email protected]>
Date:   Tue Mar 3 11:02:57 2020 +0000

sched/fair: Fix kernel build warning in test_idle_cores() for !SMT NUMA

Signature · 2 lines
Mel Gorman
SUSE Labs