Skip to contentSkip to conversation

sched/rt: Fix -Wmissing-prototypes warnings

PATCH In review Yi Wang 2 participants 2 messages Nov 13, 2018 – Nov 20, 2018 Scheduler

lore
Share & tools
lore

Yi Wang

author
#0 lore raw

PATCH 1/1 sched/rt: Fix -Wmissing-prototypes warnings

We get a warning when building kernel with W=1:
kernel/sched/rt.c:626:6: warning: no previous prototype for ‘sched_rt_bandwidth_account’ [-Wmissing-prototypes]
bool sched_rt_bandwidth_account(struct rt_rq *rt_rq)

Add the missing declaration to fix this.

---
 kernel/sched/sched.h | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/sched.h +1 -0
index 618577f..f5f29fc 100644
@@ -442,6 +442,7 @@ extern void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
 
 extern void free_rt_sched_group(struct task_group *tg);
 extern int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent);
+extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq);
 extern void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq,
 		struct sched_rt_entity *rt_se, int cpu,
 		struct sched_rt_entity *parent);
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 16 lines · Yi Wang

We get a warning when building kernel with W=1:
kernel/sched/rt.c:626:6: warning: no previous prototype for ‘sched_rt_bandwidth_account’ [-Wmissing-prototypes]
bool sched_rt_bandwidth_account(struct rt_rq *rt_rq)

Add the missing declaration to fix this.

---
 kernel/sched/sched.h | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/sched.h +0 -0
index 618577f..f5f29fc 100644

kernel/sched/sched.h extern void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq, · line 448

Quoted 7 lines
kernel/sched/sched.h +1 -0
@@ -442,6 +442,7 @@ extern void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
 
 extern void free_rt_sched_group(struct task_group *tg);
 extern int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent);
+extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq);
 extern void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq,
 		struct sched_rt_entity *rt_se, int cpu,
 		struct sched_rt_entity *parent);

This would then also render the declaration in sched/deadline.c redundant.

Or am I missing something?