From 6bb8ff46379844e92ba777fdf4db8ba5ac111482 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 19 Jun 2017 13:02:31 +0200 Subject: cpu/x86: Use do while loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/20269 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Reinauer --- src/cpu/x86/mp_init.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/cpu/x86') 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); -- cgit v1.2.3