summaryrefslogtreecommitdiffstats
path: root/kernel/power/hibernate.c
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2012-02-04 23:39:56 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2012-02-09 23:56:01 +0100
commita556d5b58345ccf51826b9ceac078072f830738b (patch)
tree35b66f1c49cf6f5437811051965f45a14f1ee15f /kernel/power/hibernate.c
parent51d6ff7acd920379f54d0be4dbe844a46178a65f (diff)
downloadop-kernel-dev-a556d5b58345ccf51826b9ceac078072f830738b.zip
op-kernel-dev-a556d5b58345ccf51826b9ceac078072f830738b.tar.gz
PM / Hibernate: Refactor and simplify freezer_test_done
The code related to 'freezer_test_done' is needlessly convoluted. Refactor the code and simplify the implementation. Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power/hibernate.c')
-rw-r--r--kernel/power/hibernate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index c6dee73..72baaf0 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -629,12 +629,8 @@ int hibernate(void)
goto Finish;
error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
- if (error)
- goto Thaw;
- if (freezer_test_done) {
- freezer_test_done = false;
+ if (error || freezer_test_done)
goto Thaw;
- }
if (in_suspend) {
unsigned int flags = 0;
@@ -659,6 +655,10 @@ int hibernate(void)
Thaw:
thaw_processes();
+
+ /* Don't bother checking whether freezer_test_done is true */
+ freezer_test_done = false;
+
Finish:
free_basic_memory_bitmaps();
usermodehelper_enable();
OpenPOWER on IntegriCloud