sched/core: Simplify if logic in sched_update_worker
Commit Message
Reduce one if statement, remove two lines of code,
and improve code clarity.
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
kernel/sched/core.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
@@ -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)