From: Andrea Bolognani Date: Mon, 20 Feb 2017 14:56:18 +0000 (+0100) Subject: conf: Remove dead code X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c6a0fb8e71bc44745332a61ce73959a84e93f9c4;p=libvirt.git conf: Remove dead code 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. --- diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 1649d84eaa..519cc6bb23 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(virDomainControllerModelPCI model) 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; }