diff options
Diffstat (limited to 'arch/powerpc/sysdev/xive/common.c')
-rw-r--r-- | arch/powerpc/sysdev/xive/common.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index 082c7e1c20f0..1cdb39575eae 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c | |||
@@ -479,7 +479,7 @@ static int xive_find_target_in_mask(const struct cpumask *mask, | |||
479 | * Now go through the entire mask until we find a valid | 479 | * Now go through the entire mask until we find a valid |
480 | * target. | 480 | * target. |
481 | */ | 481 | */ |
482 | for (;;) { | 482 | do { |
483 | /* | 483 | /* |
484 | * We re-check online as the fallback case passes us | 484 | * We re-check online as the fallback case passes us |
485 | * an untested affinity mask | 485 | * an untested affinity mask |
@@ -487,12 +487,11 @@ static int xive_find_target_in_mask(const struct cpumask *mask, | |||
487 | if (cpu_online(cpu) && xive_try_pick_target(cpu)) | 487 | if (cpu_online(cpu) && xive_try_pick_target(cpu)) |
488 | return cpu; | 488 | return cpu; |
489 | cpu = cpumask_next(cpu, mask); | 489 | cpu = cpumask_next(cpu, mask); |
490 | if (cpu == first) | ||
491 | break; | ||
492 | /* Wrap around */ | 490 | /* Wrap around */ |
493 | if (cpu >= nr_cpu_ids) | 491 | if (cpu >= nr_cpu_ids) |
494 | cpu = cpumask_first(mask); | 492 | cpu = cpumask_first(mask); |
495 | } | 493 | } while (cpu != first); |
494 | |||
496 | return -1; | 495 | return -1; |
497 | } | 496 | } |
498 | 497 | ||