]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
node_device: Use the @cap iterator variable
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Mon, 22 May 2017 06:38:20 +0000 (08:38 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 26 May 2017 14:44:05 +0000 (10:44 -0400)
Since the switch statement is already using the deref'd @cap variable
and the VIR_NODE_DEV_CAP_NET case uses it, the SCSI_HOST and PCI_DEV
cases may as well use it too.

Suggested-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
src/node_device/node_device_driver.c

index 3a6eeaaae49a77234a6009a17f487753f4aa3bd8..f597340f184401e5aec4b0a9d040b290e4ce013b 100644 (file)
@@ -54,7 +54,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
     while (cap) {
         switch (cap->data.type) {
         case VIR_NODE_DEV_CAP_SCSI_HOST:
-            nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data.scsi_host);
+            nodeDeviceSysfsGetSCSIHostCaps(&cap->data.scsi_host);
             break;
         case VIR_NODE_DEV_CAP_NET:
             if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0)
@@ -65,7 +65,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
             break;
         case VIR_NODE_DEV_CAP_PCI_DEV:
            if (nodeDeviceSysfsGetPCIRelatedDevCaps(dev->def->sysfs_path,
-                                                   &dev->def->caps->data.pci_dev) < 0)
+                                                   &cap->data.pci_dev) < 0)
               return -1;
            break;