diff mbox

[10/13] pci: Fix coding style of pci_parse_devaddr

Message ID be27db03b39715b33b54547e0868a8286c99dfad.1338799936.git.jan.kiszka@siemens.com
State New
Headers show

Commit Message

Jan Kiszka June 4, 2012, 8:52 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/hw/pci.c b/hw/pci.c
index 4d700a9..62ad61c 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -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;