Skip to content

Commit

Permalink
Freezer: remove redundant check in try_to_freeze_tasks
Browse files Browse the repository at this point in the history
We don't need to check if todo is positive before calling time_after() in
try_to_freeze_tasks(), because if todo is zero at this point, the loop will be
broken anyway due to the while () condition being false.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Jul 19, 2007
1 parent e7cd8a7 commit c2cf7d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int try_to_freeze_tasks(int freeze_user_space)
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
yield(); /* Yield is okay here */
if (todo && time_after(jiffies, end_time))
if (time_after(jiffies, end_time))
break;
} while (todo);

Expand Down

0 comments on commit c2cf7d8

Please sign in to comment.