[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 43/59] i386/amd_iommu.c: remove unneeded label in amdvi_int_re
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v1 43/59] i386/amd_iommu.c: remove unneeded label in amdvi_int_remap_msi() |
Date: |
Mon, 6 Jan 2020 15:24:09 -0300 |
'remap_fail' label can be replaced by 'return' with the
adequate error value.
CC: Michael S. Tsirkin <address@hidden>
CC: Marcel Apfelbaum <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
hw/i386/amd_iommu.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index b1175e52c7..711e1f6e40 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1268,7 +1268,7 @@ static int amdvi_int_remap_msi(AMDVIState *iommu,
trace_amdvi_ir_delivery_mode("fixed/arbitrated");
ret = __amdvi_int_remap_msi(iommu, origin, translated, dte, &irq, sid);
if (ret < 0) {
- goto remap_fail;
+ return ret;
} else {
/* Translate IRQ to MSI messages */
x86_iommu_irq_to_msi_message(&irq, translated);
@@ -1298,7 +1298,7 @@ static int amdvi_int_remap_msi(AMDVIState *iommu,
}
if (ret < 0) {
- goto remap_fail;
+ return ret;
}
/*
@@ -1309,25 +1309,20 @@ static int amdvi_int_remap_msi(AMDVIState *iommu,
dest_mode = (origin->address >> MSI_ADDR_DEST_MODE_SHIFT) & 1;
if (dest_mode) {
trace_amdvi_ir_err("invalid dest_mode");
- ret = -AMDVI_IR_ERR;
- goto remap_fail;
+ return -AMDVI_IR_ERR;
}
if (pass) {
memcpy(translated, origin, sizeof(*origin));
} else {
trace_amdvi_ir_err("passthrough is not enabled");
- ret = -AMDVI_IR_ERR;
- goto remap_fail;
+ return -AMDVI_IR_ERR;
}
out:
trace_amdvi_ir_remap_msi(origin->address, origin->data,
translated->address, translated->data);
return 0;
-
-remap_fail:
- return ret;
}
static int amdvi_int_remap(X86IOMMUState *iommu,
--
2.24.1
- Re: [PATCH v1 29/59] cryptodev-vhost.c: remove unneeded 'err' label in cryptodev_vhost_start, (continued)
- [PATCH v1 34/59] ipmi/ipmi_bt.c: remove unneeded label in ipmi_bt_handle_event, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 35/59] ipmi_bmc_extern.c: remove unneeded label in ipmi_bmc_extern_handle_command, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 37/59] s390x/event-facility.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 40/59] hsb/hcd-ehci.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 43/59] i386/amd_iommu.c: remove unneeded label in amdvi_int_remap_msi(),
Daniel Henrique Barboza <=
- [PATCH v1 50/59] rdma/rdma_backend.c: remove unneeded label in rdma_backend_init(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 16/59] block/gluster.c: remove unneeded 'exit' label, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 21/59] block/backup.c remove unneeded 'out' label in backup_run(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 22/59] block/vmdk.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 28/59] qga/commands-win32.c: remove 'out' label in get_pci_info, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 30/59] util/module.c: remove unneeded label in module_load_file(), Daniel Henrique Barboza, 2020/01/06
- Re: [PATCH v1 00/59] trivial unneeded labels cleanup, Max Reitz, 2020/01/07
- Re: [PATCH v1 00/59] trivial unneeded labels cleanup, Eric Blake, 2020/01/10