@@ -524,43 +524,47 @@ int pci_parse_devaddr(const char *addrstr, PCIDeviceAddress *addr,
p = addrstr;
val = strtoul(p, &e, 16);
- if (e == p)
- return -1;
+ if (e == p) {
+ return -1;
+ }
if (*e == ':') {
- bus = val;
- p = e + 1;
- val = strtoul(p, &e, 16);
- if (e == p)
- return -1;
- if (*e == ':') {
- dom = bus;
- bus = val;
- p = e + 1;
- val = strtoul(p, &e, 16);
- if (e == p)
- return -1;
- }
+ bus = val;
+ p = e + 1;
+ val = strtoul(p, &e, 16);
+ if (e == p) {
+ return -1;
+ }
+ if (*e == ':') {
+ dom = bus;
+ bus = val;
+ p = e + 1;
+ val = strtoul(p, &e, 16);
+ if (e == p) {
+ return -1;
+ }
+ }
}
slot = val;
if (flags & PCI_DEVADDR_WITH_FUNC) {
- if (*e != '.')
+ if (*e != '.') {
return -1;
-
+ }
p = e + 1;
val = strtoul(p, &e, 16);
- if (e == p)
+ if (e == p) {
return -1;
-
+ }
func = val;
}
- if (dom > 0xffff || bus > 0xff || slot > 0x1f || func > 7)
- return -1;
-
- if (*e)
- return -1;
+ if (dom > 0xffff || bus > 0xff || slot > 0x1f || func > 7) {
+ return -1;
+ }
+ if (*e) {
+ return -1;
+ }
addr->domain = dom;
addr->bus = bus;
So that we can move it unmodified without raising alarms. No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- hw/pci.c | 52 ++++++++++++++++++++++++++++------------------------ 1 files changed, 28 insertions(+), 24 deletions(-)