Skip to contentSkip to conversation

x86/nmi: fix timeout test in test_nmi_ipi()

PATCH In review Dan Carpenter 3 participants 3 messages Jun 19, 2017 – Jun 20, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/nmi: fix timeout test in test_nmi_ipi()

We're supposed to exit the loop with "timeout" set to zero.

Fixes 99e8b9ca90d6 ("x86, NMI: Add NMI IPI selftest")
arch/x86/kernel/nmi_selftest.c +1 -1
index 6d9582ec0324..d27f8d84c4ff 100644
@@ -78,7 +78,7 @@ static void __init test_nmi_ipi(struct cpumask *mask)
 
 	/* Don't wait longer than a second */
 	timeout = USEC_PER_SEC;
-	while (!cpumask_empty(mask) && timeout--)
+	while (!cpumask_empty(mask) && --timeout)
 	        udelay(1);
 
 	/* What happens if we timeout, do we still unregister?? */
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

We're supposed to exit the loop with "timeout" set to zero.

Fixes 99e8b9ca90d6 ("x86, NMI: Add NMI IPI selftest")
Quoted 14 lines
arch/x86/kernel/nmi_selftest.c +1 -1
index 6d9582ec0324..d27f8d84c4ff 100644
@@ -78,7 +78,7 @@ static void __init test_nmi_ipi(struct cpumask *mask)
 
 	/* Don't wait longer than a second */
 	timeout = USEC_PER_SEC;
-	while (!cpumask_empty(mask) && timeout--)
+	while (!cpumask_empty(mask) && --timeout)
 	        udelay(1);
 
 	/* What happens if we timeout, do we still unregister?? */
#2 lore raw

[tip:x86/debug] x86/nmi: Fix timeout test in test_nmi_ipi()

In reply to Dan Carpenter
x86/nmi: Fix timeout test in test_nmi_ipi()
Commit-ID:  c133c7615751008f6c32ccae7cdfc5ff6e989c35
Gitweb:     http://git.kernel.org/tip/c133c7615751008f6c32ccae7cdfc5ff6e989c35
Author:     Dan Carpenter <[email protected]>
AuthorDate: Mon, 19 Jun 2017 13:53:04 +0300
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 20 Jun 2017 12:52:43 +0200

x86/nmi: Fix timeout test in test_nmi_ipi()

We're supposed to exit the loop with "timeout" set to zero.

Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes 99e8b9ca90d6 ("x86, NMI: Add NMI IPI selftest")
---
 arch/x86/kernel/nmi_selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/nmi_selftest.c +1 -1
index 6d9582e..d27f8d8 100644
@@ -78,7 +78,7 @@ static void __init test_nmi_ipi(struct cpumask *mask)
 
 	/* Don't wait longer than a second */
 	timeout = USEC_PER_SEC;
-	while (!cpumask_empty(mask) && timeout--)
+	while (!cpumask_empty(mask) && --timeout)
 	        udelay(1);
 
 	/* What happens if we timeout, do we still unregister?? */