diff options
author | Paul Menzel <pmenzel@molgen.mpg.de> | 2017-06-19 13:02:31 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-06-22 16:01:35 +0000 |
commit | 6bb8ff46379844e92ba777fdf4db8ba5ac111482 (patch) | |
tree | df2921d6e3a4bb75e767197ad5b9b2a982ea7a98 /src | |
parent | 2721e1fab72111c28267d8b74a71c66abd887a2f (diff) |
cpu/x86: Use do while loop
With the do while loop, it can be avoided do use an infinite loop with a
break condition inside.
Change-Id: I030f6782ad618b55112a2f0bac8dda08b497a9f1
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/20269
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/cpu/x86/mp_init.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 15f3a3513e..c03efe9455 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -891,7 +891,7 @@ static int run_ap_work(mp_callback_t func, long expire_us) /* Wait for all the APs to signal back that call has been accepted. */ stopwatch_init_usecs_expire(&sw, expire_us); - while (1) { + do { cpus_accepted = 0; for (i = 0; i < ARRAY_SIZE(ap_callbacks); i++) { @@ -903,10 +903,7 @@ static int run_ap_work(mp_callback_t func, long expire_us) if (cpus_accepted == global_num_aps) return 0; - - if (stopwatch_expired(&sw)) - break; - } + } while (!stopwatch_expired(&sw)); printk(BIOS_ERR, "AP call expired. %d/%d CPUs accepted.\n", cpus_accepted, global_num_aps); |