[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251017062133.48118-1-chenxb_99091@126.com>
Date: Fri, 17 Oct 2025 14:21:33 +0800
From: XueBing Chen <chenxb_99091@....com>
To: mingo@...hat.com,
peterz@...radead.org,
juri.lelli@...hat.com,
vincent.guittot@...aro.org
Cc: dietmar.eggemann@....com,
rostedt@...dmis.org,
bsegall@...gle.com,
mgorman@...e.de,
vschneid@...hat.com,
linux-kernel@...r.kernel.org,
XueBing Chen <chenxb_99091@....com>
Subject: [PATCH] sched: Fix assignment in if condition in wait_task_inactive
Fix checkpatch.pl ERROR: "do not use assignment in if condition"
The code in wait_task_inactive() had an assignment inside an if condition,
which violates the kernel coding style. This patch separates the assignment
from the conditional check for better readability and maintainability.
Signed-off-by: XueBing Chen <chenxb_99091@....com>
---
kernel/sched/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 198d2dd45..2dae4cd53 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2305,7 +2305,8 @@ unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state
running = task_on_cpu(rq, p);
queued = task_on_rq_queued(p);
ncsw = 0;
- if ((match = __task_state_match(p, match_state))) {
+ match = __task_state_match(p, match_state);
+ if (match) {
/*
* When matching on p->saved_state, consider this task
* still queued so it will wait.
--
2.17.1
Powered by blists - more mailing lists