All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched_ext: Add missing braces to multi-line blocks
@ 2026-03-02  7:13 Cheng-Yang Chou
  2026-03-04 17:12 ` Cheng-Yang Chou
  0 siblings, 1 reply; 4+ messages in thread
From: Cheng-Yang Chou @ 2026-03-02  7:13 UTC (permalink / raw)
  To: sched-ext; +Cc: tj, void, arighi, changwoo, jserv, yphbchou0911

Add braces around outer loops and conditionals that contain multi-line
inner statements in both ext.c and ext_idle.c.

According to the kernel maintainer tip bracket rules, brackets should
only be omitted if the statement following an 'if' or 'for' is truly
a single line. This improves reading flow and prevents future errors.

Link: https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#bracket-rules

Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
---
 kernel/sched/ext.c      | 6 ++++--
 kernel/sched/ext_idle.c | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 9280381f8923..8fcee252d30e 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -5038,9 +5038,10 @@ static int scx_enable(struct sched_ext_ops *ops, struct bpf_link *link)
 		sch->exit_info->flags |= SCX_EFLAG_INITIALIZED;
 	}
 
-	for (i = SCX_OPI_CPU_HOTPLUG_BEGIN; i < SCX_OPI_CPU_HOTPLUG_END; i++)
+	for (i = SCX_OPI_CPU_HOTPLUG_BEGIN; i < SCX_OPI_CPU_HOTPLUG_END; i++) {
 		if (((void (**)(void))ops)[i])
 			set_bit(i, sch->has_op);
+	}
 
 	ret = check_hotplug_seq(sch, ops);
 	if (ret) {
@@ -5084,9 +5085,10 @@ static int scx_enable(struct sched_ext_ops *ops, struct bpf_link *link)
 	scx_bypass(true);
 	scx_bypassed_for_enable = true;
 
-	for (i = SCX_OPI_NORMAL_BEGIN; i < SCX_OPI_NORMAL_END; i++)
+	for (i = SCX_OPI_NORMAL_BEGIN; i < SCX_OPI_NORMAL_END; i++) {
 		if (((void (**)(void))ops)[i])
 			set_bit(i, sch->has_op);
+	}
 
 	if (sch->ops.cpu_acquire || sch->ops.cpu_release)
 		sch->ops.flags |= SCX_OPS_HAS_CPU_PREEMPT;
diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
index e2da6c3968a6..22bf96753f1c 100644
--- a/kernel/sched/ext_idle.c
+++ b/kernel/sched/ext_idle.c
@@ -323,9 +323,10 @@ static bool llc_numa_mismatch(void)
 	 * overlapping, which is incorrect (as NUMA 1 has two distinct LLC
 	 * domains).
 	 */
-	for_each_online_cpu(cpu)
+	for_each_online_cpu(cpu) {
 		if (llc_weight(cpu) != numa_weight(cpu))
 			return true;
+	}
 
 	return false;
 }
@@ -752,9 +753,10 @@ void __scx_update_idle(struct rq *rq, bool idle, bool do_notify)
 	 * In this way we can avoid updating the idle masks twice,
 	 * unnecessarily.
 	 */
-	if (static_branch_likely(&scx_builtin_idle_enabled))
+	if (static_branch_likely(&scx_builtin_idle_enabled)) {
 		if (do_notify || is_idle_task(rq->curr))
 			update_builtin_idle(cpu, idle);
+	}
 
 	/*
 	 * Trigger ops.update_idle() only when transitioning from a task to
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-04 18:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02  7:13 [PATCH] sched_ext: Add missing braces to multi-line blocks Cheng-Yang Chou
2026-03-04 17:12 ` Cheng-Yang Chou
2026-03-04 17:50   ` Tejun Heo
2026-03-04 18:13     ` Cheng-Yang Chou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.