summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device/pciexp_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c
index ac4e668f08..694f1dd275 100644
--- a/src/device/pciexp_device.c
+++ b/src/device/pciexp_device.c
@@ -13,7 +13,7 @@ static unsigned int pciexp_get_ext_cap_offset(const struct device *dev, unsigned
{
unsigned int this_cap_offset = offset;
unsigned int next_cap_offset, this_cap, cafe;
- do {
+ while (this_cap_offset != 0) {
this_cap = pci_read_config32(dev, this_cap_offset);
/* Bail out when this request is unsupported */
if (this_cap == 0xffffffff)
@@ -27,7 +27,7 @@ static unsigned int pciexp_get_ext_cap_offset(const struct device *dev, unsigned
next_cap_offset = this_cap >> 20;
this_cap_offset = next_cap_offset;
}
- } while (next_cap_offset != 0);
+ }
return 0;
}