diff --git a/sys/sparc64/sparc64/mp_machdep.c b/sys/sparc64/sparc64/mp_machdep.c index a314eb04c77e..7edc3a33014a 100644 --- a/sys/sparc64/sparc64/mp_machdep.c +++ b/sys/sparc64/sparc64/mp_machdep.c @@ -573,8 +573,8 @@ spitfire_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2) { u_int cpu; - while (CPU_EMPTY(&cpus)) { - cpu = cpusetobj_ffs(&cpus) - 1; + while ((cpu = cpusetobj_ffs(&cpus)) != 0) { + cpu--; CPU_CLR(cpu, &cpus); spitfire_ipi_single(cpu, d0, d1, d2); }