linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 11/14] PM: use atomic_dec_not_zero()
@ 2017-01-30 18:48 Fabian Frederick
  0 siblings, 0 replies; only message in thread
From: Fabian Frederick @ 2017-01-30 18:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, rjw, linux-pm, Fabian Frederick

instead of atomic_add_unless(value, -1, 0)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 kernel/power/user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/user.c b/kernel/power/user.c
index 22df9f7..c478572 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -54,7 +54,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
 
 	lock_system_sleep();
 
-	if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
+	if (!atomic_dec_not_zero(&snapshot_device_available)) {
 		error = -EBUSY;
 		goto Unlock;
 	}
-- 
2.9.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-30 18:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-30 18:48 [PATCH 11/14] PM: use atomic_dec_not_zero() Fabian Frederick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).