From nobody Mon Apr 29 16:53:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563523773; cv=none; d=zoho.com; s=zohoarc; b=bCgFvfdlzU1Y6LPJz1nC1zqLwpEvgXDSxkVrZuyC5HROi4i7aEfo5CzZs52IbF0tm0pE+wnsHlmX+Btt9ZWYVSBzJMeJf7rrhtGpxzAI/+tLYHSq5NnGHSeaqi/5vvowCvWrTXBbchLbJa15M5ZhD2X6qNxxutlKKsBInLpTT7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563523773; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=ntG3KEPZ8xTXZlQJh2OqHiCBZ7wBa0fWgQWhuUPL/Gw=; b=kobF1cGox/JDpaqUC+HlHAfMq2TVfTQ+q8FR+Uv2ojy5lYEOcNeWopuX+a0zlOSxBqQj1VMtw6PISrLjr30qDPgFhg7R6txl4LIPxZzBL+/W0HEOsJRON5bKpHnBfEBb9ciY2EPSw1bSqSMqiMmMXEoQ50ZMgrby+cKS/N4lXB8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563523773996785.000888723699; Fri, 19 Jul 2019 01:09:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 859163179170; Fri, 19 Jul 2019 08:09:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7FD8061F21; Fri, 19 Jul 2019 08:09:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7ED7A4E58F; Fri, 19 Jul 2019 08:09:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6J89QHl031108 for ; Fri, 19 Jul 2019 04:09:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5EDE461B9B; Fri, 19 Jul 2019 08:09:26 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEDA861B91 for ; Fri, 19 Jul 2019 08:09:23 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 19 Jul 2019 10:09:22 +0200 Message-Id: <24dedc32c5664f5b14112c810040a6aa99d8475a.1563523762.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virpci: Drop duplicate function X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 19 Jul 2019 08:09:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 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 --- src/util/virpci.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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 virZPCIDeviceAddre= ss *addr) =20 #ifdef __linux__ =20 -/* - * returns true if equal - */ -static bool -virPCIDeviceAddressIsEqual(virPCIDeviceAddressPtr bdf1, - virPCIDeviceAddressPtr bdf2) -{ - return ((bdf1->domain =3D=3D bdf2->domain) && - (bdf1->bus =3D=3D bdf2->bus) && - (bdf1->slot =3D=3D bdf2->slot) && - (bdf1->function =3D=3D bdf2->function)); -} - virPCIDeviceAddressPtr virPCIGetDeviceAddressFromSysfsLink(const char *device_link) { @@ -2787,7 +2774,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_de= vice_link, } =20 for (i =3D 0; i < num_virt_fns; i++) { - if (virPCIDeviceAddressIsEqual(vf_bdf, virt_fns[i])) { + if (virPCIDeviceAddressEqual(vf_bdf, virt_fns[i])) { *vf_index =3D i; ret =3D 0; break; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list