qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 51/59] virtio/vhost.c: remove unneeded labels


From: Daniel Henrique Barboza
Subject: [PATCH v1 51/59] virtio/vhost.c: remove unneeded labels
Date: Mon, 6 Jan 2020 15:24:17 -0300

The label 'err_features' in vhost_dev_set_log(), 'out' in
vhost_device_iotlb_miss() and 'fail' in vhost_dev_enable_notifiers()
can be replaced by 'return' with the appropriate value.

CC: Michael S. Tsirkin <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
 hw/virtio/vhost.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 4da0d5a6c5..7b36839221 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -774,7 +774,7 @@ static int vhost_dev_set_log(struct vhost_dev *dev, bool 
enable_log)
     int r, i, idx;
     r = vhost_dev_set_features(dev, enable_log);
     if (r < 0) {
-        goto err_features;
+        return r;
     }
     for (i = 0; i < dev->nvqs; ++i) {
         idx = dev->vhost_ops->vhost_get_vq_index(dev, dev->vq_index + i);
@@ -792,7 +792,6 @@ err_vq:
                                  dev->log_enabled);
     }
     vhost_dev_set_features(dev, dev->log_enabled);
-err_features:
     return r;
 }
 
@@ -938,7 +937,7 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t 
iova, int write)
             trace_vhost_iotlb_miss(dev, 3);
             error_report("Fail to lookup the translated address "
                          "%"PRIx64, iotlb.translated_addr);
-            goto out;
+            return ret;
         }
 
         len = MIN(iotlb.addr_mask + 1, len);
@@ -949,13 +948,12 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, 
uint64_t iova, int write)
         if (ret) {
             trace_vhost_iotlb_miss(dev, 4);
             error_report("Fail to update device iotlb");
-            goto out;
+            return ret;
         }
     }
 
     trace_vhost_iotlb_miss(dev, 2);
 
-out:
     return ret;
 }
 
@@ -1356,7 +1354,7 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, 
VirtIODevice *vdev)
     r = virtio_device_grab_ioeventfd(vdev);
     if (r < 0) {
         error_report("binding does not support host notifiers");
-        goto fail;
+        return r;
     }
 
     for (i = 0; i < hdev->nvqs; ++i) {
@@ -1380,7 +1378,6 @@ fail_vq:
         virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i);
     }
     virtio_device_release_ioeventfd(vdev);
-fail:
     return r;
 }
 
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]