Commit c2cf7d87d804c66e063829d5ca739053e901dc15

Authored by Rafael J. Wysocki
Committed by Linus Torvalds
1 parent e7cd8a7227

Freezer: remove redundant check in try_to_freeze_tasks

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

kernel/power/process.c
... ... @@ -149,7 +149,7 @@
149 149 } while_each_thread(g, p);
150 150 read_unlock(&tasklist_lock);
151 151 yield(); /* Yield is okay here */
152   - if (todo && time_after(jiffies, end_time))
  152 + if (time_after(jiffies, end_time))
153 153 break;
154 154 } while (todo);
155 155