Angel Pons has uploaded this change for review.

View Change

nb/intel/gm45: Make polling loops more explicit

Replace `while (...);` with `do {} while (...);` so that it's easier to
distinguish polling loops from something else, like function calls. The
`{}` can be understood as "nothing", so that the construct is naturally
read as "do nothing while (...)".

Change-Id: Ifbf3cf072f8b817b2fdeece4ef89bae0822bb6e6
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
---
M src/northbridge/intel/gm45/pcie.c
1 file changed, 18 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/69077/1
diff --git a/src/northbridge/intel/gm45/pcie.c b/src/northbridge/intel/gm45/pcie.c
index 295bf5b..59a4992 100644
--- a/src/northbridge/intel/gm45/pcie.c
+++ b/src/northbridge/intel/gm45/pcie.c
@@ -33,12 +33,12 @@
epbar_write32(EP_PORTARB(7), 0x00005555);
epbar_setbits32(EPVC1RCTL, 1 << 16);

- while ((epbar_read8(EPVC1RSTS) & 1) != 0);
+ do {} while ((epbar_read8(EPVC1RSTS) & 1) != 0);

/* VC1: enable */
epbar_setbits32(EPVC1RCTL, 1 << 31);

- while ((epbar_read8(EPVC1RSTS) & 2) != 0);
+ do {} while ((epbar_read8(EPVC1RSTS) & 2) != 0);
}

/* MCH side */
@@ -56,7 +56,7 @@
/* VC1: enable */
dmibar_setbits32(DMIVC1RCTL, 1 << 31);

- while ((dmibar_read8(DMIVC1RSTS) & VC1NP) != 0);
+ do {} while ((dmibar_read8(DMIVC1RSTS) & VC1NP) != 0);

/* additional configuration. */
dmibar_setbits32(0x200, 3 << 13);

To view, visit change 69077. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifbf3cf072f8b817b2fdeece4ef89bae0822bb6e6
Gerrit-Change-Number: 69077
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-MessageType: newchange