linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 09/14] kdb: 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, Jason Wessel, kgdb-bugreport, Fabian Frederick

instead of atomic_add_unless(value, -1, 0)

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

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index ca18391..095e6d8 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2173,7 +2173,7 @@ static int kdb_disable_nmi(int argc, const char *argv[])
 
 static int kdb_param_enable_nmi(const char *val, const struct kernel_param *kp)
 {
-	if (!atomic_add_unless(&kdb_nmi_disabled, -1, 0))
+	if (!atomic_dec_not_zero(&kdb_nmi_disabled))
 		return -EINVAL;
 	arch_kgdb_ops.enable_nmi(1);
 	return 0;
-- 
2.9.3

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

only message in thread, other threads:[~2017-01-30 18:50 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 09/14] kdb: 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).