sched/fair: Move unused stub functions to header
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 May 2023 19:50:21 +0000 (21:50 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 30 May 2023 20:46:26 +0000 (22:46 +0200)
commit7aa55f2a5902646a19db89dab9961867724b27b8
tree168e7aa96cf836259c6c1c5986f5d4eb995bf241
parentf7df852ad6dbb84644e75df7402d9a34f39f31bd
sched/fair: Move unused stub functions to header

These four functions have a normal definition for CONFIG_FAIR_GROUP_SCHED,
and empty one that is only referenced when FAIR_GROUP_SCHED is disabled
but CGROUP_SCHED is still enabled. If both are turned off, the functions
are still defined but the misisng prototype causes a W=1 warning:

kernel/sched/fair.c:12544:6: error: no previous prototype for 'free_fair_sched_group'
kernel/sched/fair.c:12546:5: error: no previous prototype for 'alloc_fair_sched_group'
kernel/sched/fair.c:12553:6: error: no previous prototype for 'online_fair_sched_group'
kernel/sched/fair.c:12555:6: error: no previous prototype for 'unregister_fair_sched_group'

Move the alternatives into the header as static inline functions with
the correct combination of #ifdef checks to avoid the warning without
adding even more complexity.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20230522195021.3456768-6-arnd@kernel.org
kernel/sched/fair.c
kernel/sched/sched.h