2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-30 21:44:06 +08:00

posix-cpu-timer: Unify the now redundant code in lookup_task

Now that both !thread paths through lookup_task call
thread_group_leader, unify them into the single test at the end of
lookup_task.

This unification just makes it clear what is happening in the gettime
special case of lookup_task.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
Eric W. Biederman 2020-04-28 13:00:39 -05:00
parent 8feebc6713
commit c7f5194054

View File

@ -66,14 +66,13 @@ static struct task_struct *lookup_task(const pid_t pid, bool thread,
if (thread)
return same_thread_group(p, current) ? p : NULL;
if (gettime) {
/*
* For clock_gettime(PROCESS) the task does not need to be
* the actual group leader. task->signal gives
* access to the group's clock.
*/
return (p == current || thread_group_leader(p)) ? p : NULL;
}
/*
* For clock_gettime(PROCESS) the task does not need to be
* the actual group leader. task->signal gives
* access to the group's clock.
*/
if (gettime && (p == current))
return p;
/*
* For processes require that p is group leader.