mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-07-04 04:59:28 +03:00
util: Remove need for ret in virPCIGetPhysicalFunction
Since the callers only ever expect 0 or -1, let's just return that directly Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
@ -2487,21 +2487,20 @@ int
|
|||||||
virPCIGetPhysicalFunction(const char *vf_sysfs_path,
|
virPCIGetPhysicalFunction(const char *vf_sysfs_path,
|
||||||
virPCIDeviceAddressPtr *pf)
|
virPCIDeviceAddressPtr *pf)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
char *device_link = NULL;
|
char *device_link = NULL;
|
||||||
|
|
||||||
if (virBuildPath(&device_link, vf_sysfs_path, "physfn") == -1) {
|
if (virBuildPath(&device_link, vf_sysfs_path, "physfn") == -1) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
return ret;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = virPCIGetDeviceAddressFromSysfsLink(device_link, pf)) >= 0) {
|
if (virPCIGetDeviceAddressFromSysfsLink(device_link, pf) >= 0) {
|
||||||
VIR_DEBUG("PF for VF device '%s': %.4x:%.2x:%.2x.%.1x", vf_sysfs_path,
|
VIR_DEBUG("PF for VF device '%s': %.4x:%.2x:%.2x.%.1x", vf_sysfs_path,
|
||||||
(*pf)->domain, (*pf)->bus, (*pf)->slot, (*pf)->function);
|
(*pf)->domain, (*pf)->bus, (*pf)->slot, (*pf)->function);
|
||||||
}
|
}
|
||||||
VIR_FREE(device_link);
|
VIR_FREE(device_link);
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user