From: Michal Privoznik Date: Thu, 18 Jul 2019 18:28:15 +0000 (+0200) Subject: virpci: Drop duplicate function X-Git-Tag: v5.6.0-rc1~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fc601e7a63870368e45c16753b2b89439e2e269;p=thirdparty%2Flibvirt.git virpci: Drop duplicate function 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 Reviewed-by: Erik Skultety --- diff --git a/src/util/virpci.c b/src/util/virpci.c index ae3a0fa886..6dc0a2711c 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -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;