diff mbox series

[1/5] iommu: trivial re-organisation to avoid unnecessary test

Message ID 20190508132403.1454-2-paul.durrant@citrix.com (mailing list archive)
State Superseded
Headers show
Series iommu groups + cleanup | expand

Commit Message

Paul Durrant May 8, 2019, 1:23 p.m. UTC
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 <paul.durrant@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Beulich May 13, 2019, 3:22 p.m. UTC | #1
>>> On 08.05.19 at 15:23, <paul.durrant@citrix.com> wrote:
> 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 <paul.durrant@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

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" :