[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
- [PATCH v1 44/59] 9p-local.c: remove unneeded label in local_unlinkat_common(), (continued)
- [PATCH v1 44/59] 9p-local.c: remove unneeded label in local_unlinkat_common(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 45/59] 9pfs/9p.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 47/59] pvrdma_main.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 49/59] rdma/rdma_rm.c: remove unneeded label in rdma_rm_alloc_pd(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 51/59] virtio/vhost.c: remove unneeded labels,
Daniel Henrique Barboza <=
- [PATCH v1 52/59] net/vhost_net.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 53/59] net/net_tx_pkt.c: remove unneeded label in net_tx_pkt_get_gso_type(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 54/59] ivshmem-server/main.c: remove unneeded label in main(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 55/59] linux-user/flatload.c: remove unused 'out' label, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 32/59] qemu-img.c: remove 'out4' label in img_compare, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 36/59] ipmi/ipmi_kcs.c: remove unneeded label in ipmi_kcs_handle_event, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 42/59] i386/intel_iommu.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 46/59] alpha/typhoon.c: remove unneeded label in typhoon_translate_iommu(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 48/59] pvrdma_dev_ring.c: remove unneeded label in pvrdma_ring_init(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 56/59] linux-user/signal.c: remove unneeded label in do_sigaltstack(), Daniel Henrique Barboza, 2020/01/06