DORMANTno replies

[PATCH 11/14] PM: use atomic_dec_not_zero()

From: Fabian Frederick <hidden>
Date: 2017-01-30 18:50:15
Also in: lkml
Subsystem: hibernation (aka software suspend, aka swsusp), suspend to ram, the rest · Maintainers: "Rafael J. Wysocki", Linus Torvalds

instead of atomic_add_unless(value, -1, 0)

Signed-off-by: Fabian Frederick <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help