sched/core: avoid assignment in conditional expression
PATCH 1/1 sched/core: avoid assignment in conditional expression
Split the assignment from the conditional expression when matching task state. This improves readability and avoids the use of assignment within an if condition, which is discouraged by the kernel coding style.
No functional change intended.
Signed-off-by Zhan Xusheng <[email protected]>
--- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/core.c +2 -1
@@ -2275,7 +2275,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.43.0