[coreboot-gerrit] Change in coreboot[master]: Use stopwatch_wait_until_expired where applicable
Martin Roth (Code Review)
gerrit at coreboot.org
Tue Sep 26 18:53:29 CEST 2017
Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/21590 )
Change subject: Use stopwatch_wait_until_expired where applicable
......................................................................
Use stopwatch_wait_until_expired where applicable
Change-Id: I4d6c6810b91294a7e401a4a1a446218c04c98e55
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Reviewed-on: https://review.coreboot.org/21590
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Mario Scheithauer <mario.scheithauer at siemens.com>
---
M src/drivers/i2c/rx6110sa/rx6110sa.c
M src/ec/google/chromeec/ec_spi.c
M src/lib/timer.c
M src/mainboard/google/oak/romstage.c
M src/mainboard/siemens/mc_apl1/mainboard.c
5 files changed, 7 insertions(+), 11 deletions(-)
Approvals:
build bot (Jenkins): Verified
Mario Scheithauer: Looks good to me, approved
diff --git a/src/drivers/i2c/rx6110sa/rx6110sa.c b/src/drivers/i2c/rx6110sa/rx6110sa.c
index aad1097..69ea9fe 100644
--- a/src/drivers/i2c/rx6110sa/rx6110sa.c
+++ b/src/drivers/i2c/rx6110sa/rx6110sa.c
@@ -149,8 +149,7 @@
* Take the needed delay after a reset sequence into account before the
* VLF-bit can be cleared.
*/
- while (!stopwatch_expired(&sw))
- ;
+ stopwatch_wait_until_expired(&sw);
flags &= ~VLF_BIT;
rx6110sa_write(dev, FLAG_REGISTER, flags);
diff --git a/src/ec/google/chromeec/ec_spi.c b/src/ec/google/chromeec/ec_spi.c
index 810979e..3611814 100644
--- a/src/ec/google/chromeec/ec_spi.c
+++ b/src/ec/google/chromeec/ec_spi.c
@@ -51,8 +51,9 @@
struct spi_slave *slave = (struct spi_slave *)context;
int ret = 0;
- while (!stopwatch_expired(&cs_cooldown_sw))
- /* Wait minimum delay between CS assertions. */;
+ /* Wait minimum delay between CS assertions. */
+ stopwatch_wait_until_expired(&cs_cooldown_sw);
+
spi_claim_bus(slave);
/* Allow EC to ramp up clock after being awaken.
diff --git a/src/lib/timer.c b/src/lib/timer.c
index 58d32ee..adc0d07 100644
--- a/src/lib/timer.c
+++ b/src/lib/timer.c
@@ -34,7 +34,5 @@
return;
stopwatch_init_usecs_expire(&sw, usec);
-
- while (!stopwatch_expired(&sw))
- ;
+ stopwatch_wait_until_expired(&sw);
}
diff --git a/src/mainboard/google/oak/romstage.c b/src/mainboard/google/oak/romstage.c
index a92e4fb..1f56547 100644
--- a/src/mainboard/google/oak/romstage.c
+++ b/src/mainboard/google/oak/romstage.c
@@ -55,8 +55,7 @@
/* init memory */
mt_mem_init(get_sdram_config());
- while (!stopwatch_expired(&sw))
- ;
+ stopwatch_wait_until_expired(&sw);
/* Set to maximum frequency */
if (board_id() + CONFIG_BOARD_ID_ADJUSTMENT < 5)
diff --git a/src/mainboard/siemens/mc_apl1/mainboard.c b/src/mainboard/siemens/mc_apl1/mainboard.c
index fb849f9..f77ef75 100644
--- a/src/mainboard/siemens/mc_apl1/mainboard.c
+++ b/src/mainboard/siemens/mc_apl1/mainboard.c
@@ -165,8 +165,7 @@
stopwatch_init_msecs_expire(&sw, (legacy_delay - us_since_boot) / 1000);
printk(BIOS_NOTICE, "Wait remaining %d of %d us for legacy devices...",
legacy_delay - us_since_boot, legacy_delay);
- while (!stopwatch_expired(&sw))
- ;
+ stopwatch_wait_until_expired(&sw);
printk(BIOS_NOTICE, "done!\n");
}
--
To view, visit https://review.coreboot.org/21590
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4d6c6810b91294a7e401a4a1a446218c04c98e55
Gerrit-Change-Number: 21590
Gerrit-PatchSet: 3
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Gerrit-Reviewer: Mario Scheithauer <mario.scheithauer at siemens.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170926/7c7366dd/attachment.html>
More information about the coreboot-gerrit
mailing list