Replace the for loop with a simple if.

Signed-off-by: Mandeep Singh Baines <[email protected]>
CC: Oleg Nesterov <[email protected]>
CC: Tejun Heo <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Rafael J. Wysocki <[email protected]>
CC: Ingo Molnar <[email protected]>
---
 kernel/exit.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index b4df219..f215198 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -479,12 +479,9 @@ static void exit_mm(struct task_struct * tsk)
                if (atomic_dec_and_test(&core_state->nr_threads))
                        complete(&core_state->startup);
 
-               for (;;) {
-                       set_task_state(tsk, TASK_UNINTERRUPTIBLE);
-                       if (!self.task) /* see coredump_finish() */
-                               break;
+               set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+               if (self.task) /* see coredump_finish() */
                        schedule();
-               }
                __set_task_state(tsk, TASK_RUNNING);
                down_read(&mm->mmap_sem);
        }
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to