'out' label in vtd_lookup_iotlb() and 'done' label in
vtd_process_device_iotlb_desc() can be replaced by
'return' with the apropriate value.

CC: Michael S. Tsirkin <m...@redhat.com>
CC: Marcel Apfelbaum <marcel.apfelb...@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb...@gmail.com>
---
 hw/i386/intel_iommu.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 43c94b993b..e0dd987851 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -304,11 +304,10 @@ static VTDIOTLBEntry *vtd_lookup_iotlb(IntelIOMMUState 
*s, uint16_t source_id,
                                 source_id, level);
         entry = g_hash_table_lookup(s->iotlb, &key);
         if (entry) {
-            goto out;
+            return entry;
         }
     }
 
-out:
     return entry;
 }
 
@@ -2380,12 +2379,12 @@ static bool 
vtd_process_device_iotlb_desc(IntelIOMMUState *s,
 
     vtd_bus = vtd_find_as_from_bus_num(s, bus_num);
     if (!vtd_bus) {
-        goto done;
+        return true;
     }
 
     vtd_dev_as = vtd_bus->dev_as[devfn];
     if (!vtd_dev_as) {
-        goto done;
+        return true;
     }
 
     /* According to ATS spec table 2.4:
@@ -2410,7 +2409,6 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState 
*s,
     entry.translated_addr = 0;
     memory_region_notify_iommu(&vtd_dev_as->iommu, 0, entry);
 
-done:
     return true;
 }
 
-- 
2.24.1


Reply via email to