There is only one switch in virtio_blk_pci_io_out and virtio_blk_pci_io_in. No need to use goto, just use break is fine. Signed-off-by: Asias He <asias.hejun@xxxxxxxxx> --- tools/kvm/virtio-blk.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/kvm/virtio-blk.c b/tools/kvm/virtio-blk.c index 79f27c1..06e58bc 100644 --- a/tools/kvm/virtio-blk.c +++ b/tools/kvm/virtio-blk.c @@ -81,7 +81,7 @@ static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, in break; case VIRTIO_PCI_GUEST_FEATURES: ret = false; - goto out_unlock; + break; case VIRTIO_PCI_QUEUE_PFN: ioport__write32(data, blk_device.vqs[blk_device.queue_selector].pfn); break; @@ -91,7 +91,7 @@ static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, in case VIRTIO_PCI_QUEUE_SEL: case VIRTIO_PCI_QUEUE_NOTIFY: ret = false; - goto out_unlock; + break; case VIRTIO_PCI_STATUS: ioport__write8(data, blk_device.status); break; @@ -104,10 +104,8 @@ static bool virtio_blk_pci_io_in(struct kvm *self, uint16_t port, void *data, in break; default: ret = virtio_blk_pci_io_device_specific_in(data, offset, size, count); - goto out_unlock; }; -out_unlock: mutex_unlock(&blk_device.mutex); return ret; @@ -220,10 +218,8 @@ static bool virtio_blk_pci_io_out(struct kvm *self, uint16_t port, void *data, i break; default: ret = false; - goto out_unlock; }; -out_unlock: mutex_unlock(&blk_device.mutex); return ret; -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html