From: Oleg Nesterov Date: Mon, 26 Jun 2006 07:26:02 +0000 (-0700) Subject: [PATCH] cleanup next_tid() X-Git-Tag: v2.6.18-rc1~743 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1df7fb88a011b39ea722ac00975c5b8a803261b;p=linux-2.6 [PATCH] cleanup next_tid() Try to make next_tid() a bit more readable and deletes unnecessary "pid_alive(pos)" check. Signed-off-by: Oleg Nesterov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/base.c b/fs/proc/base.c index 5ee46d3a5c..43871c8572 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2267,15 +2267,15 @@ out: */ static struct task_struct *next_tid(struct task_struct *start) { - struct task_struct *pos; + struct task_struct *pos = NULL; rcu_read_lock(); - pos = start; - if (pid_alive(start)) + if (pid_alive(start)) { pos = next_thread(start); - if (pid_alive(pos) && (pos != start->group_leader)) - get_task_struct(pos); - else - pos = NULL; + if (thread_group_leader(pos)) + pos = NULL; + else + get_task_struct(pos); + } rcu_read_unlock(); put_task_struct(start); return pos;