summaryrefslogtreecommitdiffstats
path: root/kernel/power/user.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/user.c
parentPM / Hibernate: Thaw kernel threads in hibernation_snapshot() in error/test path (diff)
downloadlinux-a556d5b58345ccf51826b9ceac078072f830738b.tar.xz
linux-a556d5b58345ccf51826b9ceac078072f830738b.zip
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/user.c')
-rw-r--r--kernel/power/user.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 7bee91f9af51..33c4329205af 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -251,10 +251,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
error = hibernation_snapshot(data->platform_support);
if (!error) {
error = put_user(in_suspend, (int __user *)arg);
- if (!error && !freezer_test_done)
- data->ready = 1;
- if (freezer_test_done)
- freezer_test_done = false;
+ data->ready = !freezer_test_done && !error;
+ freezer_test_done = false;
}
break;