提交 3e692179 编写于 作者: M Marc Hartmayer 提交者: John Ferlan

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: NBjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
上级 a8eba503
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册