Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1df7fb8 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

[PATCH] cleanup next_tid()



Try to make next_tid() a bit more readable and deletes unnecessary
"pid_alive(pos)" check.

Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a872ff0c
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -2267,15 +2267,15 @@ out:
 */
 */
static struct task_struct *next_tid(struct task_struct *start)
static struct task_struct *next_tid(struct task_struct *start)
{
{
	struct task_struct *pos;
	struct task_struct *pos = NULL;
	rcu_read_lock();
	rcu_read_lock();
	pos = start;
	if (pid_alive(start)) {
	if (pid_alive(start))
		pos = next_thread(start);
		pos = next_thread(start);
	if (pid_alive(pos) && (pos != start->group_leader))
		if (thread_group_leader(pos))
		get_task_struct(pos);
	else
			pos = NULL;
			pos = NULL;
		else
			get_task_struct(pos);
	}
	rcu_read_unlock();
	rcu_read_unlock();
	put_task_struct(start);
	put_task_struct(start);
	return pos;
	return pos;