]> xenbits.xensource.com Git - libvirt.git/commitdiff
nodedev: Indent PCI express for future fix
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 15 Mar 2016 12:13:48 +0000 (13:13 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 18 Mar 2016 16:35:06 +0000 (17:35 +0100)
Best viewed with '-w' as this is just an adjustment for future patch to
be readable without that.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/node_device/node_device_udev.c

index 100b44d2018691c2d98317228aa4457ef13ffe82..aaee0e503d7bf93c6d8111e7d088a93036a68737 100644 (file)
@@ -505,28 +505,30 @@ static int udevProcessPCI(struct udev_device *device,
         goto out;
 
     /* We need to be root to read PCI device configs */
-    if (priv->privileged && virPCIDeviceIsPCIExpress(pciDev) > 0) {
-        if (VIR_ALLOC(pci_express) < 0)
-            goto out;
-
-        if (virPCIDeviceHasPCIExpressLink(pciDev) > 0) {
-            if (VIR_ALLOC(pci_express->link_cap) < 0 ||
-                VIR_ALLOC(pci_express->link_sta) < 0)
+    if (priv->privileged) {
+        if (virPCIDeviceIsPCIExpress(pciDev) > 0) {
+            if (VIR_ALLOC(pci_express) < 0)
                 goto out;
 
-            if (virPCIDeviceGetLinkCapSta(pciDev,
-                                          &pci_express->link_cap->port,
-                                          &pci_express->link_cap->speed,
-                                          &pci_express->link_cap->width,
-                                          &pci_express->link_sta->speed,
-                                          &pci_express->link_sta->width) < 0)
-                goto out;
+            if (virPCIDeviceHasPCIExpressLink(pciDev) > 0) {
+                if (VIR_ALLOC(pci_express->link_cap) < 0 ||
+                    VIR_ALLOC(pci_express->link_sta) < 0)
+                    goto out;
 
-            pci_express->link_sta->port = -1; /* PCIe can't negotiate port. Yet :) */
+                if (virPCIDeviceGetLinkCapSta(pciDev,
+                                              &pci_express->link_cap->port,
+                                              &pci_express->link_cap->speed,
+                                              &pci_express->link_cap->width,
+                                              &pci_express->link_sta->speed,
+                                              &pci_express->link_sta->width) < 0)
+                    goto out;
+
+                pci_express->link_sta->port = -1; /* PCIe can't negotiate port. Yet :) */
+            }
+            data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCIE;
+            data->pci_dev.pci_express = pci_express;
+            pci_express = NULL;
         }
-        data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCIE;
-        data->pci_dev.pci_express = pci_express;
-        pci_express = NULL;
     }
 
     ret = 0;