Re: [PATCH] PM/Hibernate: Refactor and simplify freezer_test_done

From: Tejun Heo
Date: Thu Feb 02 2012 - 12:17:33 EST


On Thu, Feb 02, 2012 at 07:10:19AM +0530, Srivatsa S. Bhat wrote:
> @@ -251,10 +251,10 @@ 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;
> + else if (!error)
> + data->ready = 1;

Hmmm... how about..

data->ready = !freezer_test_done && !error;
freezer_test_done = false;

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