From nobody Mon Feb 9 08:41:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1658322743; cv=none; d=zohomail.com; s=zohoarc; b=fVvAeJNFe++lipg2wSWgXchDwcHgLnzj27sN39/X7mQR9sKFTKWUMnbGRd1YuK8CXIk9MWOpzu7AVELzqxCV5a/H/MAvD9hi8OcnWOFcMUpwMPvZJ3wVF9DwmS5JhCY97xPrVaY1zQX140fcN46rhe/rBDokcCcRHkL4ihXFPg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322743; 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=lD/NdsMiTPke8xF4wnPzKGeAnYdbafrkE13DeSpzjC0=; b=hBg8Inx8pFMbbqwe7e/u6wAoDd/fMwgY0LeF8oevbKNLfm/IJ4rUcu+MQ41x41ZjGScnFJ3S9AdDbiM7u3pEhWA0F4QAUKUP3xiGIrLeqjo7n/uy6RPk9SctE1jNUCG0le7Jo8KuhBFHwIE1ZXQOwsTQ1l3GbPsDeGSyHsKs4/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16583227435161016.307623029755; Wed, 20 Jul 2022 06:12:23 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-225-6-BVR4lYOSmcBFbYqghF6Q-1; Wed, 20 Jul 2022 09:12:19 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 449A338041EB; Wed, 20 Jul 2022 13:12:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DE7A18EA8; Wed, 20 Jul 2022 13:12:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 404DA1923CBA; Wed, 20 Jul 2022 13:12:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 004031947066 for ; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D708140D296B; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8298F40D2962 for ; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322742; 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=lD/NdsMiTPke8xF4wnPzKGeAnYdbafrkE13DeSpzjC0=; b=Ib1E5A3o0BDGOvSg9/EgA47RJ85Jt4V/ctvTcm+3dLfQTL23sZQDBlbtLnx2iwP/XbBqz9 JP2yz6HKeOdHof7KfUxayjw5LboARyeF9+tYFC7Wi/HSVf41APRBVXQ14Gdmtz8P4rRUYd t03CCg7A5R+y8MLCReIx8Oit9HikGL8= X-MC-Unique: 6-BVR4lYOSmcBFbYqghF6Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 5/9] domain_conf: replace switch with if in virDomainChrDefFree() Date: Wed, 20 Jul 2022 15:11:08 +0200 Message-Id: <3b8128204eb71cad87e82361f57d34ac9fe5f5c3.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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) X-ZM-MESSAGEID: 1658322743805100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Switch is used for just one case, so I replaced it with a simple if condition. Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b903dac1cb..f51476c968 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2904,8 +2904,7 @@ void virDomainChrDefFree(virDomainChrDef *def) if (!def) return; =20 - switch (def->deviceType) { - case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: + if (def->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) { switch (def->targetType) { case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: g_free(def->target.addr); @@ -2916,10 +2915,6 @@ void virDomainChrDefFree(virDomainChrDef *def) g_free(def->target.name); break; } - break; - - default: - break; } =20 virObjectUnref(def->source); --=20 2.35.3