From nobody Sun Feb 8 20:53:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1606911438; cv=none; d=zohomail.com; s=zohoarc; b=JvAoxUCfennGmh0E3FNefYTw+O7xEZMYthfbUSZi3UEiJuaL5A6DUZdGQfkwt9h2cNT4P+V5gubaAJdmtCLVwRDXjXe5yop6UlcILC/GIrVkjC361Wtj/Q1MDgKxGcMGByL6sToBXvoWdJqUfNVaZA4o4kefSs11yKr7hHn4HNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606911438; 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=62xJs/CapoBGcS+XfCX7+9iLEKDagV8dgiNs2KyQ2ls=; b=bI4aeyvhNub8nzX34fTMKqP5zjpVAN3PIth5w7dm7Zf6n4XYpum/n2JlmzJmRrQ2DC5b4sV/vrhPEGv5U7qX+V9m2QZy0TEZQ4HgulCbRpYwytj4LjqfQ/Wz93BZM62KNblogl1ia/H5badPcxtjripxuHk1FAk80ovqnoHnLYI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1606911438350812.6326070861704; Wed, 2 Dec 2020 04:17:18 -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-217-ruQVmLJBNuq8KOBwWO6rEQ-1; Wed, 02 Dec 2020 07:15:39 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2FEFE9A22E; Wed, 2 Dec 2020 12:15:33 +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 0712C19D9B; Wed, 2 Dec 2020 12:15:33 +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 C635D50037; Wed, 2 Dec 2020 12:15:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B2CFVj4031974 for ; Wed, 2 Dec 2020 07:15:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 11C3E189B6; Wed, 2 Dec 2020 12:15:31 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 628EF189A5 for ; Wed, 2 Dec 2020 12:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606911437; 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=62xJs/CapoBGcS+XfCX7+9iLEKDagV8dgiNs2KyQ2ls=; b=f1t6vC5yo2jBHcxw2KIqx5buZj224IxUzN5Xoi/iPoqu+S3Qo2c9qMBCrvJ2jt5BxBWBcu hbHFk5G6OiiXBTplwyB/4yKCCO55kk3aAGttR98qlSnJ9U6beq2QyFX7SJYwmOu/R8tx+B g8+RdvkBy0q9osBk/cLS4OpBGD2r2DY= X-MC-Unique: ruQVmLJBNuq8KOBwWO6rEQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/11] virDomainDiskByName: Remove ternary operator Date: Wed, 2 Dec 2020 13:14:59 +0100 Message-Id: <3d7cc3eb74eb22726eea375ffb1d82616af79e9a.1606911231.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.23 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 49b68c2c68..6922ebf407 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17649,7 +17649,11 @@ virDomainDiskByName(virDomainDefPtr def, bool allow_ambiguous) { int idx =3D virDomainDiskIndexByName(def, name, allow_ambiguous); - return idx < 0 ? NULL : def->disks[idx]; + + if (idx < 0) + return NULL; + + return def->disks[idx]; } --=20 2.28.0