Skip to contentSkip to conversation

kdb: use atomic_dec_not_zero()

PATCH In review Fabian Frederick 1 participant 1 message Jan 30, 2017 KGDB / KDB /debug_core

lore
Share & tools
lore
#0 lore raw

PATCH 9/14 kdb: use atomic_dec_not_zero()

instead of atomic_add_unless(value, -1, 0)

---
 kernel/debug/kdb/kdb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/debug/kdb/kdb_main.c +1 -1
index ca18391..095e6d8 100644
@@ -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;
Signature · 1 line
2.9.3