Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1570019 > unrolled thread

[PATCH 09/14] kdb: use atomic_dec_not_zero()

Started byFabian Frederick <fabf@skynet.be>
First post2017-01-30 20:00 +0100
Last post2017-01-30 20:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 09/14] kdb: use atomic_dec_not_zero() Fabian Frederick <fabf@skynet.be> - 2017-01-30 20:00 +0100

#1570019 — [PATCH 09/14] kdb: use atomic_dec_not_zero()

FromFabian Frederick <fabf@skynet.be>
Date2017-01-30 20:00 +0100
Subject[PATCH 09/14] kdb: use atomic_dec_not_zero()
Message-ID<t5plg-7sP-7@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web