node_device: Use the @cap iterator variable

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>
This commit is contained in:
Marc Hartmayer 2017-05-22 08:38:20 +02:00 committed by John Ferlan
parent a8eba5036c
commit 3e69217953

View 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;