]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Remove need for ret in virPCIGetPhysicalFunction
authorJohn Ferlan <jferlan@redhat.com>
Tue, 17 May 2016 14:38:47 +0000 (10:38 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 19 May 2016 20:30:04 +0000 (16:30 -0400)
Since the callers only ever expect 0 or -1, let's just return that directly

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/util/virpci.c

index be35017dad9f6c8d077e2db8061ef96bfe30d49e..1119c2ed7583a31ded6fde85e90df2cb80baf0fc 100644 (file)
@@ -2487,21 +2487,20 @@ int
 virPCIGetPhysicalFunction(const char *vf_sysfs_path,
                           virPCIDeviceAddressPtr *pf)
 {
-    int ret = -1;
     char *device_link = NULL;
 
     if (virBuildPath(&device_link, vf_sysfs_path, "physfn") == -1) {
         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,
                   (*pf)->domain, (*pf)->bus, (*pf)->slot, (*pf)->function);
     }
     VIR_FREE(device_link);
 
-    return ret;
+    return 0;
 }