]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virpci: Drop duplicate function
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jul 2019 18:28:15 +0000 (20:28 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 19 Jul 2019 08:51:18 +0000 (10:51 +0200)
We have two functions: virPCIDeviceAddressIsEqual() defined only
on Linux and virPCIDeviceAddressEqual() defined everywhere. And
both of them do the same. Drop the former in favour of the
latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/util/virpci.c

index ae3a0fa8867a770b3012969bed1f011a33f1f806..6dc0a2711c2d04f49913c35efde5369a652990da 100644 (file)
@@ -2590,19 +2590,6 @@ virZPCIDeviceAddressIsEmpty(const virZPCIDeviceAddress *addr)
 
 #ifdef __linux__
 
-/*
- * returns true if equal
- */
-static bool
-virPCIDeviceAddressIsEqual(virPCIDeviceAddressPtr bdf1,
-                           virPCIDeviceAddressPtr bdf2)
-{
-    return ((bdf1->domain == bdf2->domain) &&
-            (bdf1->bus == bdf2->bus) &&
-            (bdf1->slot == bdf2->slot) &&
-            (bdf1->function == bdf2->function));
-}
-
 virPCIDeviceAddressPtr
 virPCIGetDeviceAddressFromSysfsLink(const char *device_link)
 {
@@ -2787,7 +2774,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
     }
 
     for (i = 0; i < num_virt_fns; i++) {
-        if (virPCIDeviceAddressIsEqual(vf_bdf, virt_fns[i])) {
+        if (virPCIDeviceAddressEqual(vf_bdf, virt_fns[i])) {
             *vf_index = i;
             ret = 0;
             break;