From patchwork Wed May 8 13:23:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 10935659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E709112C for ; Wed, 8 May 2019 13:25:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BD98284FF for ; Wed, 8 May 2019 13:25:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CA2F28563; Wed, 8 May 2019 13:25:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC62D284FF for ; Wed, 8 May 2019 13:25:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOMYP-0000dE-BW; Wed, 08 May 2019 13:24:13 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOMYO-0000d9-8W for xen-devel@lists.xenproject.org; Wed, 08 May 2019 13:24:12 +0000 X-Inumbo-ID: 8f0ecd8a-7194-11e9-afcc-479c29bd2a1d Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8f0ecd8a-7194-11e9-afcc-479c29bd2a1d; Wed, 08 May 2019 13:24:08 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,446,1549929600"; d="scan'208";a="85265424" From: Paul Durrant To: Date: Wed, 8 May 2019 14:23:59 +0100 Message-ID: <20190508132403.1454-2-paul.durrant@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190508132403.1454-1-paul.durrant@citrix.com> References: <20190508132403.1454-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/5] iommu: trivial re-organisation to avoid unnecessary test X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Paul Durrant , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP An 'if ( !iommu_enabled )' followed by an 'if ( iommu_enabled )' with only a printk() in between seems a little silly. Move the printk() and use 'else' instead. Signed-off-by: Paul Durrant Acked-by: Jan Beulich --- Cc: Jan Beulich --- xen/drivers/passthrough/iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index a6697d58fb..b453b32191 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -512,14 +512,14 @@ int __init iommu_setup(void) if ( !iommu_intremap ) iommu_intpost = 0; + printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis"); if ( !iommu_enabled ) { iommu_snoop = 0; iommu_hwdom_passthrough = false; iommu_hwdom_strict = false; } - printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis"); - if ( iommu_enabled ) + else { printk(" - Dom0 mode: %s\n", iommu_hwdom_passthrough ? "Passthrough" :