sched/core: Convert get_task_struct() to return the task
Returning the pointer that was passed in allows us to write slightly more idiomatic code. Convert a few users. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190704221323.24290-1-willy@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
3c29e651e1
commit
7b3c92b85a
@@ -628,8 +628,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
|
||||
}
|
||||
|
||||
/* [10] Grab the next task, i.e. owner of @lock */
|
||||
task = rt_mutex_owner(lock);
|
||||
get_task_struct(task);
|
||||
task = get_task_struct(rt_mutex_owner(lock));
|
||||
raw_spin_lock(&task->pi_lock);
|
||||
|
||||
/*
|
||||
@@ -709,8 +708,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
|
||||
}
|
||||
|
||||
/* [10] Grab the next task, i.e. the owner of @lock */
|
||||
task = rt_mutex_owner(lock);
|
||||
get_task_struct(task);
|
||||
task = get_task_struct(rt_mutex_owner(lock));
|
||||
raw_spin_lock(&task->pi_lock);
|
||||
|
||||
/* [11] requeue the pi waiters if necessary */
|
||||
|
Reference in New Issue
Block a user