From nobody Mon Feb 9 08:34:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1639152730; cv=none; d=zohomail.com; s=zohoarc; b=HPR/C9a5i2+9aPoSw7jQZlm07njhu0fJLkQ7zBxiofoF4LRPkvwhj1eSPqdszB1ZeW1OdDaciVpGhRYdsfh5spGXnNpF2MYY5tVXbnt/u8dkcbosA8QuWNK1nKyDUK6SMkl/jSvFChuqG0ZBznAMPN0TKBTWI4Ej7CnB9N2x7nc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639152730; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kdeDeZXaebJd6o5cIT0wisOs2g8W5iVdEtTSGkdUzjs=; b=LZJp1INc+i9DfxRQl2Ob4K9NSQbjNVT5JqhWhGGduKN/Z1Cno+Y6mpYdmUDspmLN+Mvbq+OJ/aLz8w5F0t/9/7gvokc3UW9ZUNtxmeCxVr5dyN8CYiJUiCt1MM5JRCNIhaGCKlKkR9/8W/z1ZFkSmyrstgF0No6s64snlVX3650= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1639152730016527.7400411395075; Fri, 10 Dec 2021 08:12:10 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-35-QQ5FnIs8PTCkbPyb1oWEvA-1; Fri, 10 Dec 2021 11:12:07 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D73A91015214; Fri, 10 Dec 2021 16:11:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92DC1781FF; Fri, 10 Dec 2021 16:11:58 +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 618281809CBF; Fri, 10 Dec 2021 16:11:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BAG6PEG015267 for ; Fri, 10 Dec 2021 11:06:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id D8E2560C04; Fri, 10 Dec 2021 16:06:25 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60A3960C4A for ; Fri, 10 Dec 2021 16:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639152728; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kdeDeZXaebJd6o5cIT0wisOs2g8W5iVdEtTSGkdUzjs=; b=KlZZzZTSOU1aephyCxMX3ZqVupDcJeL3h5SBPJ84rKLLDel4ciI/7sVyYmCgpqPCDoBwii 4MZ6zARQ4rz8j9VKFbSxDH5FSWXxqvP8sq5KRHgFAMbXmvNAJWfrBP1Clx0DiW+sYvxDGo G0nK1KjE5ANJSVNSJ0nNw8BU0/hGRW8= X-MC-Unique: QQ5FnIs8PTCkbPyb1oWEvA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 7/8] bhyve: bhyveConnectCompareCPU: remove cleanup label Date: Fri, 10 Dec 2021 17:06:17 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639152731703100002 Return the desired values directly and clean up the redundant else branches. Signed-off-by: J=C3=A1n Tomko --- src/bhyve/bhyve_driver.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index e445c8cadf..cb1544665e 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -1431,7 +1431,6 @@ bhyveConnectCompareCPU(virConnectPtr conn, unsigned int flags) { struct _bhyveConn *driver =3D conn->privateData; - int ret =3D VIR_CPU_COMPARE_ERROR; g_autoptr(virCaps) caps =3D NULL; bool failIncompatible; bool validateXML; @@ -1441,30 +1440,27 @@ bhyveConnectCompareCPU(virConnectPtr conn, VIR_CPU_COMPARE_ERROR); =20 if (virConnectCompareCPUEnsureACL(conn) < 0) - goto cleanup; + return VIR_CPU_COMPARE_ERROR; =20 failIncompatible =3D !!(flags & VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATI= BLE); validateXML =3D !!(flags & VIR_CONNECT_COMPARE_CPU_VALIDATE_XML); =20 if (!(caps =3D bhyveDriverGetCapabilities(driver))) - goto cleanup; + return VIR_CPU_COMPARE_ERROR; =20 if (!caps->host.cpu || !caps->host.cpu->model) { if (failIncompatible) { virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", _("cannot get host CPU capabilities")); - } else { - VIR_WARN("cannot get host CPU capabilities"); - ret =3D VIR_CPU_COMPARE_INCOMPATIBLE; + return VIR_CPU_COMPARE_ERROR; } - } else { - ret =3D virCPUCompareXML(caps->host.arch, caps->host.cpu, - xmlDesc, failIncompatible, validateXML); + VIR_WARN("cannot get host CPU capabilities"); + return VIR_CPU_COMPARE_INCOMPATIBLE; } =20 - cleanup: - return ret; + return virCPUCompareXML(caps->host.arch, caps->host.cpu, + xmlDesc, failIncompatible, validateXML); } =20 static int --=20 2.31.1