From nobody Tue Nov 26 15:38:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1571852847; cv=none; d=zoho.com; s=zohoarc; b=WrJ1/zkmsokO6IyRSElm9TVVdiWw2uR5+pMLOxUebfPZ8QxzhqLY/kYecL47xlfY97CqwUtHgVHsKSsLvEOtOnn/fWsOKejz6aBg4xWAEkChefTyA9oWO8cvuGM384Xlmb21q//XM79eyxsZoK8fD7Uule1HoWPVKv1U6V3tsaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571852847; h=Content-Type:Content-Transfer-Encoding:Cc: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=Aas/q+HHvz8nGVJFInPhkY2w6d6ijNFy4fii3S/IEnE=; b=ZJEyqLsyA/PAaf+CJOCt3mP7uIBVwROf0sLtPsfIb0Tf37mRbOlacX2EM3rhu6kkT+bZ0YjcOQUcixRzDJh3E8KkGqTjpn7C4E0AgOkJtu0rh8Oy9lpaFuKTgYe9GKnfvY2AB2QoPfqKP3nTw/QV9DPJ5Gga6mma4sTfNC9bYdQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571852847750282.77410835062756; Wed, 23 Oct 2019 10:47:27 -0700 (PDT) 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-216-rIXtGkB2PC6uW_qrFfEsIw-1; Wed, 23 Oct 2019 13:47:25 -0400 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 8AF26801E66; Wed, 23 Oct 2019 17:47:20 +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 643A860624; Wed, 23 Oct 2019 17:47:20 +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 1596E4EBC7; Wed, 23 Oct 2019 17:47:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9NHks5a008828 for ; Wed, 23 Oct 2019 13:46:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E0F260629; Wed, 23 Oct 2019 17:46:54 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-117-228.phx2.redhat.com [10.3.117.228]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA1A16061E; Wed, 23 Oct 2019 17:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571852846; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=Aas/q+HHvz8nGVJFInPhkY2w6d6ijNFy4fii3S/IEnE=; b=ILyw0rt3hwaq3kCgoorx5FEU5o0/Iq7GsbNZUVohlcdMRuHx5DNRT/SojNiwrvfk+jNFfo e2baLvgrR02FVvhfHhL1USJ8W0iEBmshL7xKqs/UzCqDpzjugqpFg8tkB/MgJF2DyvY9Pb X+GMhf3EBvvPAsmo6AXLq9OBxOW9Gz8= From: Jonathon Jongsma To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:46:46 -0500 Message-Id: <20191023174649.28887-3-jjongsma@redhat.com> In-Reply-To: <20191023174649.28887-1-jjongsma@redhat.com> References: <20191023174649.28887-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: jtomko@redhat.com, crobinso@redhat.com Subject: [libvirt] [PATCH v2 2/5] conf: remove unnecessary NULL checks 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 X-MC-Unique: rIXtGkB2PC6uW_qrFfEsIw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Just above in the function, we return from the function if either x or y are NULL, so there's no need to re-check whether x or y are NULL. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9ee9b44a5e..ad1d3ffea6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15365,20 +15365,16 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr no= de) if (VIR_ALLOC(def) < 0) goto cleanup; =20 - if (x) { - if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot parse video x-resolution '%s'"), x); - goto cleanup; - } + if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot parse video x-resolution '%s'"), x); + goto cleanup; } =20 - if (y) { - if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot parse video y-resolution '%s'"), y); - goto cleanup; - } + if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot parse video y-resolution '%s'"), y); + goto cleanup; } =20 cleanup: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list