From nobody Mon Feb 9 08:28:20 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=1571434846; cv=none; d=zoho.com; s=zohoarc; b=mYPyNqhlZCj7x/lTgs1hOlttsael+QK6MxLZGTXoGlh0Yi4kHiCa6A5uoGKXoMsrb/S75MBpa/8gzheumfYtMHbUXgXjOfHGW2aggZc0C6oHm4vUvjDZ2FAeVAwO0OKYVxfX6AYB78CuYVcujHW1MgGcAqP/YrmOJ4BEUvaaNWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571434846; 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=7X8fubwIbJV7PCp3jjN4xLmIsz0i7baGKKeACtcvLQ4=; b=Su2YEtg77mEd3n3cscP/D/MkSsqre/XEYuAJkQSU433+8pqzvizAx82TWG/UkDPvxM5kzyxrsR4grcAw20OMe4CLZWXU+VIItax5ptKP5pujtADz3wfRZa4yCalz/Cr3TlK+2+OwvXR3xQC7nxPbNYPTtGpdqoNtwi15FkZqe5w= 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 1571434846670581.0861584368647; Fri, 18 Oct 2019 14:40:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F17DE18CCEE3; Fri, 18 Oct 2019 21:40:44 +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 C74E07E2E; Fri, 18 Oct 2019 21:40:44 +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 806F44EE97; Fri, 18 Oct 2019 21:40:44 +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 x9ILeVNr022434 for ; Fri, 18 Oct 2019 17:40:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 76FA05C226; Fri, 18 Oct 2019 21:40:31 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-117-200.phx2.redhat.com [10.3.117.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D3785C1B5; Fri, 18 Oct 2019 21:40:28 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Fri, 18 Oct 2019 16:40:21 -0500 Message-Id: <20191018214023.25481-4-jjongsma@redhat.com> In-Reply-To: <20191018214023.25481-1-jjongsma@redhat.com> References: <20191018214023.25481-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: jcfaracco@gmail.com, crobinso@redhat.com Subject: [libvirt] [PATCH 3/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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Fri, 18 Oct 2019 21:40:45 +0000 (UTC) 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 5657faf039..a446ce4d62 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15370,20 +15370,16 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr no= de) =20 def =3D g_new0(virDomainVideoResolutionDef, 1); =20 - if (x) { - if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot parse video x-resolution '%s'"), x); - return NULL; - } + if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot parse video x-resolution '%s'"), x); + return NULL; } =20 - if (y) { - if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot parse video y-resolution '%s'"), y); - return NULL; - } + if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot parse video y-resolution '%s'"), y); + return NULL; } =20 return g_steal_pointer(&def); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list