sched/core: Simplify if logic in sched_update_worker
PATCH 1/1 sched/core: Simplify if logic in sched_update_worker
Reduce one if statement, remove two lines of code, and improve code clarity.
Signed-off-by Wang Jinchao <[email protected]>
--- kernel/sched/core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
kernel/sched/core.c +4 -6
@@ -6748,12 +6748,10 @@ static inline void sched_submit_work(struct task_struct *tsk)static void sched_update_worker (struct task_struct *tsk) { -if (tsk->flags & (PF_WQ_WORKER |PF_IO_WORKER )) { -if (tsk->flags &PF_WQ_WORKER ) -wq_worker_running (tsk); -else -io_wq_worker_running (tsk); - } +if (tsk->flags &PF_WQ_WORKER ) +wq_worker_running (tsk); +else if (tsk->flags &PF_IO_WORKER ) +io_wq_worker_running (tsk); } static __always_inline void __schedule_loop(unsigned int sched_mode)
Signature · 1 line
2.40.0