lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20170130184743.18402-1-fabf@skynet.be>
Date:   Mon, 30 Jan 2017 19:47:43 +0100
From:   Fabian Frederick <fabf@...net.be>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org, rjw@...ysocki.net,
        linux-pm@...r.kernel.org, Fabian Frederick <fabf@...net.be>
Subject: [PATCH 07/14] PM / RUNTIME: use atomic_dec_not_zero()

instead of atomic_add_unless(value, -1, 0)

Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 drivers/base/power/runtime.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 872eac4..8ed435f 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -603,7 +603,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 
 	if (dev->parent) {
 		parent = dev->parent;
-		atomic_add_unless(&parent->power.child_count, -1, 0);
+		atomic_dec_not_zero(&parent->power.child_count);
 	}
 	wake_up_all(&dev->power.wait_queue);
 
@@ -1116,7 +1116,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status)
 		}
 
 		if (parent) {
-			atomic_add_unless(&parent->power.child_count, -1, 0);
+			atomic_dec_not_zero(&parent->power.child_count);
 			notify_parent = !parent->power.ignore_children;
 		}
 		goto out_set;
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ