kernel/sched/rt.c defines stub versions of free_rt_sched_group and alloc_rt_sched_group, for use when CONFIG_RT_GROUP_SCHED=n. However, sched.h only declares the prototypes of those functions when CONFIG_CGROUP_SCHED=y, since the scheduler core only calls those functions when CONFIG_CGROUP_SCHED=y. Rather than complicating the ifdef logic around the stub functions to only define them in that case, move the empty stubs to sched.h as static inlines, only defined when needed. That allows the compiler to throw away the calls entirely rather than calling empty stubs, and also satisfies GCC (-Wmissing-prototypes) and Sparse (-Wdecl).
kernel/sched/rt.c:220:6: warning: no previous prototype for ‘free_rt_sched_group’ [-Wmissing-prototypes] kernel/sched/rt.c:222:5: warning: no previous prototype for ‘alloc_rt_sched_group’ [-Wmissing-prototypes] Signed-off-by: Josh Triplett <j...@joshtriplett.org> --- kernel/sched/rt.c | 7 ------- kernel/sched/sched.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 418feb0..9ef9d0e 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -216,13 +216,6 @@ static inline struct rt_rq *rt_rq_of_se(struct sched_rt_entity *rt_se) return &rq->rt; } - -void free_rt_sched_group(struct task_group *tg) { } - -int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent) -{ - return 1; -} #endif /* CONFIG_RT_GROUP_SCHED */ #ifdef CONFIG_SMP diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index fc5b8b8..ae190e1 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -199,8 +199,19 @@ extern void __refill_cfs_bandwidth_runtime(struct cfs_bandwidth *cfs_b); extern void __start_cfs_bandwidth(struct cfs_bandwidth *cfs_b); extern void unthrottle_cfs_rq(struct cfs_rq *cfs_rq); +#ifdef CONFIG_RT_GROUP_SCHED extern void free_rt_sched_group(struct task_group *tg); extern int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent); +#else +static inline void free_rt_sched_group(struct task_group *tg) { } + +static inline int alloc_rt_sched_group(struct task_group *tg, + struct task_group *parent) +{ + return 1; +} +#endif + 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); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/