Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750708AbWCST3K (ORCPT ); Sun, 19 Mar 2006 14:29:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750727AbWCST3K (ORCPT ); Sun, 19 Mar 2006 14:29:10 -0500 Received: from mail.tv-sign.ru ([213.234.233.51]:34763 "EHLO several.ru") by vger.kernel.org with ESMTP id S1750708AbWCST3J (ORCPT ); Sun, 19 Mar 2006 14:29:09 -0500 Message-ID: <441DB048.A8349576@tv-sign.ru> Date: Sun, 19 Mar 2006 22:26:00 +0300 From: Oleg Nesterov X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.20 i686) X-Accept-Language: en MIME-Version: 1.0 To: "Eric W. Biederman" , Andrew Morton Cc: linux-kernel@vger.kernel.org Subject: [PATCH] cleanup next_tid() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 36 This patch tries to make next_tid() a bit more readable and deletes unnecessary "pid_alive(pos)" check. Signed-off-by: Oleg Nesterov --- MM/fs/proc/base.c~ 2006-03-20 00:02:08.000000000 +0300 +++ MM/fs/proc/base.c 2006-03-20 00:52:02.000000000 +0300 @@ -2215,15 +2215,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)) - pos = next_thread(start); - if (pid_alive(pos) && (pos != start->group_leader)) - get_task_struct(pos); - else - pos = NULL; + if (pid_alive(start)) { + pos = next_thread(start); + if (thread_group_leader(pos)) + pos = NULL; + else + get_task_struct(pos); + } rcu_read_unlock(); put_task_struct(start); return pos; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/