Skip to contentSkip to conversation

sched/numa: fix build without CONFIG_NUMA_BALANCING

PATCH In review Arnd Bergmann 2 participants 2 messages Jun 28, 2017 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/numa: fix build without CONFIG_NUMA_BALANCING

I ran into a build error:

kernel/sched/fair.c:2655:44: error: 'struct sched_domain' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

Adding a forward declaration for the struct name is sufficient to avoid it.

Fixes 3fed382b46ba ("sched/numa: Implement NUMA node level wake_affine()")
---
 kernel/sched/fair.c | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/fair.c +1 -0
index 6f4f155adf5f..eea8f0b7d9c0 100644
@@ -2652,6 +2652,7 @@ static inline void account_numa_dequeue(struct rq *rq, struct task_struct *p)
 {
 }
 
+struct sched_domain;
 static inline bool numa_wake_affine(struct sched_domain *sd,
 				    struct task_struct *p, int this_cpu,
 				    int prev_cpu, int sync)
Signature · 1 line
2.9.0
#1 lore raw
Quoted 6 lines · Arnd Bergmann

I ran into a build error:

kernel/sched/fair.c:2655:44: error: 'struct sched_domain' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

Quoted 6 lines

Adding a forward declaration for the struct name is sufficient to avoid it.

Fixes 3fed382b46ba ("sched/numa: Implement NUMA node level

wake_affine()")

Peter pointed out another problem with that patch.

I am running a few tests now on a kernel with that other bug fixed, which should also magically get rid of this compiler warning.

Signature · 1 line
All rights reversed