From nobody Tue Apr 23 17:19:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 148770729845019.146784580083136; Tue, 21 Feb 2017 12:01:38 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1LJvpTB031882; Tue, 21 Feb 2017 14:57:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1LJvnE1020736 for ; Tue, 21 Feb 2017 14:57:49 -0500 Received: from inaba.usersys.redhat.com (ovpn-204-99.brq.redhat.com [10.40.204.99]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LJvjbC002979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 21 Feb 2017 14:57:48 -0500 From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 21 Feb 2017 20:57:39 +0100 Message-Id: <1487707064-29602-2-git-send-email-abologna@redhat.com> In-Reply-To: <1487707064-29602-1-git-send-email-abologna@redhat.com> References: <1487707064-29602-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] conf: Remove dead code 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The switch in virDomainPCIControllerModelToConnectType() had some code that, while techically part of the _PCIE_SWITCH_DOWNSTREAM_PORT case, was in fact dead due to the early return. Get rid of the dead code, and fix the inaccurate function description while at it. --- src/conf/domain_addr.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 1649d84..519cc6b 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -35,9 +35,8 @@ VIR_LOG_INIT("conf.domain_addr"); virDomainPCIConnectFlags virDomainPCIControllerModelToConnectType(virDomainControllerModelPCI model) { - /* given a VIR_DOMAIN_CONTROLLER_MODEL_PCI*, set connectType to - * the equivalent VIR_PCI_CONNECT_TYPE_*. return 0 on success, -1 - * if the model wasn't recognized. + /* given a VIR_DOMAIN_CONTROLLER_MODEL_PCI*, return + * the equivalent VIR_PCI_CONNECT_TYPE_*. */ switch (model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: @@ -70,14 +69,6 @@ virDomainPCIControllerModelToConnectType(virDomainContro= llerModelPCI model) =20 case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT: return VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT; - - /* if this happens, there is an error in the code. A - * PCI controller should always have a proper model - * set - */ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI controller model incorrectly set to 'last'")= ); - return -1; } return 0; } --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list