From nobody Sun Feb 8 23:26:51 2026 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=1568913237; cv=none; d=zoho.com; s=zohoarc; b=bUgFHjqhJOV1zit2/ucIqG+mreCo43GjGNj6yfZrzgdK50sFd3jLD4CKGs7UIVRkv82VGLZHNfYuGw6pYYNzTnxJ2F6bJTVN10Clh6tD/OarDk2KS5afLkS9UEjY3HjFA01SM9c0ZOA0Obi4fhP2sHFQh9tcSD+jt9oqmyBx8h8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568913237; 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:ARC-Authentication-Results; bh=KypHUSIZBxp4Gz1POWO2/jpHW71K51xQQfnzXfQPUFE=; b=kYU9jGBYcDccicj55pD4csoSKWWZB35KDM5aIz/JHoBOWIAQlqIyTe4b+AogJJ5Izu0HwWonXoEjncFsiVy4u3Ez9OQP3k2hTsdYlYKJUYI+zPPkOR9w98CWftlwraFo1TjhxcHm4M+YwPlohAkZoN064hxiHE5WbxtNtHledA8= 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 1568913237823207.52845978377616; Thu, 19 Sep 2019 10:13:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42C9AC05683F; Thu, 19 Sep 2019 17:13:56 +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 1AC6C5DA60; Thu, 19 Sep 2019 17:13:56 +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 C8C774EE72; Thu, 19 Sep 2019 17:13:55 +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 x8JHDWRV004591 for ; Thu, 19 Sep 2019 13:13:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id E089E60C18; Thu, 19 Sep 2019 17:13:32 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68AA760BF1 for ; Thu, 19 Sep 2019 17:13:32 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 19:13:07 +0200 Message-Id: <94e6ee244b02ce4944a7716e68d2a9ead7518158.1568911535.git.pkrempa@redhat.com> 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 Subject: [libvirt] [PATCH 04/22] util: typedparam: Remove pointless cleanup label from virTypedParameterAssignFromStr 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 19 Sep 2019 17:13:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virtypedparam-public.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/util/virtypedparam-public.c b/src/util/virtypedparam-publi= c.c index fb7f178c6c..eaa9f433e7 100644 --- a/src/util/virtypedparam-public.c +++ b/src/util/virtypedparam-public.c @@ -34,18 +34,16 @@ virTypedParameterAssignFromStr(virTypedParameterPtr par= am, int type, const char *val) { - int ret =3D -1; - if (!val) { virReportError(VIR_ERR_INVALID_ARG, _("NULL value for field '%s'"), name); - goto cleanup; + return -1; } if (virStrcpyStatic(param->field, name) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Field name '%s' too long= "), name); - goto cleanup; + return -1; } param->type =3D type; @@ -55,7 +53,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, virReportError(VIR_ERR_INVALID_ARG, _("Invalid value for field '%s': expected int"), name); - goto cleanup; + return -1; } break; case VIR_TYPED_PARAM_UINT: @@ -64,7 +62,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, _("Invalid value for field '%s': " "expected unsigned int"), name); - goto cleanup; + return -1; } break; case VIR_TYPED_PARAM_LLONG: @@ -73,7 +71,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, _("Invalid value for field '%s': " "expected long long"), name); - goto cleanup; + return -1; } break; case VIR_TYPED_PARAM_ULLONG: @@ -82,7 +80,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, _("Invalid value for field '%s': " "expected unsigned long long"), name); - goto cleanup; + return -1; } break; case VIR_TYPED_PARAM_DOUBLE: @@ -91,7 +89,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, _("Invalid value for field '%s': " "expected double"), name); - goto cleanup; + return -1; } break; case VIR_TYPED_PARAM_BOOLEAN: @@ -102,22 +100,20 @@ virTypedParameterAssignFromStr(virTypedParameterPtr p= aram, } else { virReportError(VIR_ERR_INVALID_ARG, _("Invalid boolean value for field '%s'"), name= ); - goto cleanup; + return -1; } break; case VIR_TYPED_PARAM_STRING: if (VIR_STRDUP(param->value.s, val) < 0) - goto cleanup; + return -1; break; default: virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected type %d for field %s"), type, name); - goto cleanup; + return -1; } - ret =3D 0; - cleanup: - return ret; + return 0; } /* The following APIs are public and their signature may never change. */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list