From: Oleg Nesterov 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 --- fs/proc/base.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff -puN fs/proc/base.c~cleanup-next_tid fs/proc/base.c --- devel/fs/proc/base.c~cleanup-next_tid 2006-04-14 23:44:30.000000000 -0700 +++ devel-akpm/fs/proc/base.c 2006-04-14 23:44:30.000000000 -0700 @@ -2260,15 +2260,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; _