Skip to contentSkip to conversation

kernel: smp: correct warning in on_each_cpu_cond

PATCH New Sasha Levin 1 participant 1 message Aug 4, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel: smp: correct warning in on_each_cpu_cond

smp_call_function_single() returns 0 on success, not the other way around. Fix the warning to trigger on failure rather than success.

---
 kernel/smp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/smp.c +1 -1
index 487653b..aff8aa1 100644
@@ -670,7 +670,7 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
 			if (cond_func(cpu, info)) {
 				ret = smp_call_function_single(cpu, func,
 								info, wait);
-				WARN_ON_ONCE(!ret);
+				WARN_ON_ONCE(ret);
 			}
 		preempt_enable();
 	}
Signature · 1 line
1.7.10.4