[0/2] sched: Return NULL when entity isn't a task

Message ID 20231201022704.3526377-1-yajun.deng@linux.dev
Headers
Series sched: Return NULL when entity isn't a task |

Message

Yajun Deng Dec. 1, 2023, 2:27 a.m. UTC
  If the entity isn't a task, return the task struct is meaningless.
Return NULL when entity isn't a task that makes the code more concise.

Yajun Deng (2):
  sched/fair: Return NULL when entity isn't a task in task_of()
  sched/rt: Return NULL when rt entity isn't a task in rt_task_of()

 kernel/sched/fair.c  | 50 +++++++++++++++++------------------
 kernel/sched/rt.c    | 62 ++++++++++++--------------------------------
 kernel/sched/sched.h |  4 ++-
 3 files changed, 44 insertions(+), 72 deletions(-)