Skip to contentSkip to conversation

sched_ext: Fix inconsistent indenting in scx_enable()

PATCH New Cheng-Yang Chou 1 participant 1 message Mar 11

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched_ext: Fix inconsistent indenting in scx_enable()

When CONFIG_EXT_SUB_SCHED is disabled, the #ifdef block in scx_enable() splits an if/else statement. This leaves the fallback kthread_init_work() with an extra indentation level, triggering an inconsistent indenting warning from smatch.

Fix this by adding an explicit #else branch, keeping macro boundaries clean and proper indentation across all configs.

---
 kernel/sched/ext.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/sched/ext.c +3 -1
index e7ab3647e35f..21cbefb4ecb8 100644
@@ -6914,8 +6914,10 @@ static s32 scx_enable(struct sched_ext_ops *ops, struct bpf_link *link)
 	if (ops->sub_cgroup_id > 1)
 		kthread_init_work(&cmd.work, scx_sub_enable_workfn);
 	else
-#endif	/* CONFIG_EXT_SUB_SCHED */
 		kthread_init_work(&cmd.work, scx_root_enable_workfn);
+#else
+	kthread_init_work(&cmd.work, scx_root_enable_workfn);
+#endif  /* CONFIG_EXT_SUB_SCHED */
 	cmd.ops = ops;
 
 	kthread_queue_work(READ_ONCE(helper), &cmd.work);
Signature · 1 line
2.48.1