sched: Fix assignment in if condition in wait_task_inactive
PATCH 1/1 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 <[email protected]>
--- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/core.c +2 -1
@@ -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.
Signature · 1 line
2.17.1