From nobody Sun Feb 8 22:08:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1580207526258731.9818729568034; Tue, 28 Jan 2020 02:32:06 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-238-Nj9_AR3dNlSpPvgzTPNM3w-1; Tue, 28 Jan 2020 05:32:02 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFBEE107ACCA; Tue, 28 Jan 2020 10:31:57 +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 8AC3D863C9; Tue, 28 Jan 2020 10:31:57 +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 3988385974; Tue, 28 Jan 2020 10:31:57 +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 00SAVaZl014000 for ; Tue, 28 Jan 2020 05:31:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 57A785C21B; Tue, 28 Jan 2020 10:31:36 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6B955C21A for ; Tue, 28 Jan 2020 10:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580207525; 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=1EM+LnEun6AIchSrFazUOumvqWaGBUQ8MyIqc8gupwU=; b=F9/RfV7HWomJ1QJlF3nFEjXR71DYNowVtZw8W0FSeCnt0+JVdTZR1kDGVZwdGCcURQTYbt qP+ebgQAV97Dtzw496p/JG7xU7M4RdzHV+eLh79MOnZGZg+QCU4fLWT/mY3TnibQFAKcNB 6pDrJE+sweXWaPq5qMtrtHVNkAk+zMo= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 02/10] qemu: eliminate ret variable in qemuExtTPMStartEmulator Date: Tue, 28 Jan 2020 11:31:18 +0100 Message-Id: <78e55652f4f05a3a9deefbd674210cb501133d83.1580207305.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.11 X-MC-Unique: Nj9_AR3dNlSpPvgzTPNM3w-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now that the cleanup section is empty, eliminate the cleanup label as well as the 'ret' variable. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- src/qemu/qemu_tpm.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index c2132250eb..21792f6992 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -793,7 +793,6 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver, virDomainObjPtr vm, bool incomingMigration) { - int ret =3D -1; g_autoptr(virCommand) cmd =3D NULL; int exitstatus =3D 0; g_autofree char *errbuf =3D NULL; @@ -817,23 +816,23 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver, cfg->swtpm_group, cfg->swtpmStateDir, shortName, incomingMigration))) - goto cleanup; + return -1; =20 if (qemuExtDeviceLogCommand(driver, vm, cmd, "TPM Emulator") < 0) - goto cleanup; + return -1; =20 virCommandSetErrorBuffer(cmd, &errbuf); =20 if (qemuSecurityStartTPMEmulator(driver, vm, cmd, cfg->swtpm_user, cfg->swtpm_group, &exitstatus, &cmdret) < 0) - goto cleanup; + return -1; =20 if (cmdret < 0 || exitstatus !=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not start 'swtpm'. exitstatus: %d, " "error: %s"), exitstatus, errbuf); - goto cleanup; + return -1; } =20 /* check that the swtpm has written its pid into the file */ @@ -852,15 +851,12 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver, if (timeout <=3D 0) goto error; =20 - ret =3D 0; - - cleanup: - return ret; + return 0; =20 error: virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("swtpm failed to start")); - goto cleanup; + return -1; } =20 =20 --=20 2.21.0