Skip to contentSkip to conversation

sched/fair: fix a -Wmissing-prototypes warning

PATCH New chen zhang 1 participant 1 message Sep 7, 2022 Scheduler

lore
Share & tools
lore

chen zhang

author
#0 lore raw

PATCH 1/1 sched/fair: fix a -Wmissing-prototypes warning

We get a warning when building kernel with W=1:

kernel/sched/fair.c:11510:6: warning: no previous prototype for ‘task_vruntime_update’ [-Werror=missing-prototypes]

Add the missing declaration in head file to fix this. And remove the unnecessary declaration in kernel/sched/core.c.

---
 kernel/sched/core.c  | 2 --
 kernel/sched/sched.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
kernel/sched/core.c +0 -2
index b60422300af6..5a354b4bcd0c 100644
@@ -5874,8 +5874,6 @@ static inline struct task_struct *pick_task(struct rq *rq)
 	BUG(); /* The idle class should always have a runnable task. */
 }
 
-extern void task_vruntime_update(struct rq *rq, struct task_struct *p, bool in_fi);
-
 static void queue_core_balance(struct rq *rq);
 
 static struct task_struct *
kernel/sched/sched.h +2 -0
index f616e0cec20c..ae8554356108 100644
@@ -2268,6 +2268,8 @@ static inline bool sched_fair_runnable(struct rq *rq)
 extern struct task_struct *pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf);
 extern struct task_struct *pick_next_task_idle(struct rq *rq);
 
+extern void task_vruntime_update(struct rq *rq, struct task_struct *p, bool in_fi);
+
 #define SCA_CHECK		0x01
 #define SCA_MIGRATE_DISABLE	0x02
 #define SCA_MIGRATE_ENABLE	0x04
Signature · 1 line
2.25.1