summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorCheng-Yang Chou <yphbchou0911@gmail.com>2026-03-22 21:48:16 +0800
committerTejun Heo <tj@kernel.org>2026-03-22 10:02:11 -1000
commite73b1d7210c02ff223e2786934d5a6e73eab1999 (patch)
tree75c9505abcc0b72f9a0de0acee85f9a3e8795f22 /init
parent068014daad8d07bc11b24c223bc2d2c331b458bd (diff)
sched_ext: Fix build errors and unused label warning in non-cgroup configs
When building with SCHED_CLASS_EXT=y but CGROUPS=n, clang reports errors for undeclared cgroup_put() and cgroup_get() calls, and a warning for the unused err_stop_helper label. EXT_SUB_SCHED is def_bool y depending only on SCHED_CLASS_EXT, but it fundamentally requires cgroups (cgroup_path, cgroup_get, cgroup_put, cgroup_id, etc.). Add the missing CGROUPS dependency to EXT_SUB_SCHED in init/Kconfig. Guard cgroup_put() and cgroup_get() in the common paths with: #if defined(CONFIG_EXT_GROUP_SCHED) || defined(CONFIG_EXT_SUB_SCHED) Guard the err_stop_helper label with #ifdef CONFIG_EXT_SUB_SCHED since all gotos targeting it are inside that same ifdef block. Tested with both CGROUPS enabled and disabled. Fixes: ebeca1f930ea ("sched_ext: Introduce cgroup sub-sched support") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202603210903.IrKhPd6k-lkp@intel.com/ Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com> Acked-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 06abd8e272cb..487a93e34be9 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1178,7 +1178,7 @@ endif #CGROUP_SCHED
config EXT_SUB_SCHED
def_bool y
- depends on SCHED_CLASS_EXT
+ depends on SCHED_CLASS_EXT && CGROUPS
config SCHED_MM_CID
def_bool y