mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: rahadbhuiya <rahadbhuiya2021@gmail.com>
To: Tejun Heo <tj@kernel.org>, Andrea Righi <arighi@nvidia.com>
Cc: linux-kernel@vger.kernel.org, rahadbhuiya <rahadbhuiya2021@gmail.com>
Subject: [PATCH] sched_ext: Fix coding style and macro parenthesization in ext and cid
Date: Fri, 18 Sep 2026 20:38:44 +0600	[thread overview]
Message-ID: <20260918143844.1279-1-rahadbhuiya2021@gmail.com> (raw)

Fix several checkpatch issues in kernel/sched/ext/:

- Convert SPDX comment to C++ style in ext.c and cid.c per
  Documentation/process/license-rules.rst.
- Parenthesize SCX_CID_TOPO_NEG and scx_enabling_sub_sched macro
  definitions to avoid precedence side effects.
- Put struct initialization opening brace on the same line in
  scx_tg_online().
- Remove prohibited space before semicolon in scx_bypass().
- Add blank line after local variable declaration in
  scx_alloc_and_add_sched().

Signed-off-by: rahadbhuiya <rahadbhuiya2021@gmail.com>
---
 kernel/sched/ext/cid.c |  6 +++---
 kernel/sched/ext/ext.c | 20 +++++++++++---------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/kernel/sched/ext/cid.c b/kernel/sched/ext/cid.c
index bc4eee5bb4cb..ef0a29a88cd1 100644
--- a/kernel/sched/ext/cid.c
+++ b/kernel/sched/ext/cid.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
 /*
  * BPF extensible scheduler class: Documentation/scheduler/sched-ext.rst
  *
@@ -28,10 +28,10 @@ struct scx_cid_topo __rcu *scx_cid_topo;
 
 static struct scx_cid_tables *scx_cid_tables;	/* used only during alloc/free */
 
-#define SCX_CID_TOPO_NEG	(struct scx_cid_topo) {				\
+#define SCX_CID_TOPO_NEG	((struct scx_cid_topo) {			\
 	.core_cid = -1, .core_idx = -1, .llc_cid = -1, .llc_idx = -1,		\
 	.node_cid = -1, .node_idx = -1, .shard_cid = -1, .shard_idx = -1,	\
-}
+})
 
 /*
  * Return @cpu's LLC shared_cpu_map. If cacheinfo isn't populated (offline or
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index 3219f0da0fe4..a807754ff1f0 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+// SPDX-License-Identifier: GPL-2.0
 /*
  * BPF extensible scheduler class: Documentation/scheduler/sched-ext.rst
  *
@@ -129,7 +129,7 @@ static atomic64_t scx_sched_id_cursor = ATOMIC64_INIT(0);
  */
 struct scx_sched *scx_enabling_sub_sched;
 #else
-#define scx_enabling_sub_sched	(struct scx_sched *)NULL
+#define scx_enabling_sub_sched	((struct scx_sched *)NULL)
 #endif	/* CONFIG_EXT_SUB_SCHED */
 
 /*
@@ -4779,12 +4779,13 @@ int scx_tg_online(struct task_group *tg)
 			sch = scx_tg_sched(&root_task_group);
 
 		if (SCX_HAS_OP(sch, cgroup_init)) {
-			struct scx_cgroup_init_args args =
-				{ .weight = tg->scx.weight,
-				  .bw_period_us = tg->scx.bw_period_us,
-				  .bw_quota_us = tg->scx.bw_quota_us,
-				  .bw_burst_us = tg->scx.bw_burst_us,
-				  .sched_idle = tg->scx.idle };
+			struct scx_cgroup_init_args args = {
+				.weight = tg->scx.weight,
+				.bw_period_us = tg->scx.bw_period_us,
+				.bw_quota_us = tg->scx.bw_quota_us,
+				.bw_burst_us = tg->scx.bw_burst_us,
+				.sched_idle = tg->scx.idle,
+			};
 
 			ret = SCX_CALL_OP_RET(sch, cgroup_init,
 					      NULL, tg->css.cgroup, &args);
@@ -6200,7 +6201,7 @@ void scx_bypass(struct scx_sched *sch, bool bypass)
 
 			/* cycling deq/enq is enough, see the function comment */
 			scoped_guard (sched_change, p, DEQUEUE_SAVE | DEQUEUE_MOVE) {
-				/* nothing */ ;
+				/* nothing */;
 			}
 		}
 
@@ -7288,6 +7289,7 @@ struct scx_sched *scx_alloc_and_add_sched(struct scx_enable_cmd *cmd,
 
 #ifdef CONFIG_EXT_SUB_SCHED
 	char *buf = kzalloc(PATH_MAX, GFP_KERNEL);
+
 	if (!buf) {
 		ret = -ENOMEM;
 		goto err_free_lb_resched;
-- 
2.54.0.windows.1


                 reply	other threads:[~2026-09-18 14:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260918143844.1279-1-rahadbhuiya2021@gmail.com \
    --to=rahadbhuiya2021@gmail.com \
    --cc=arighi@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®