[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 40/59] hsb/hcd-ehci.c: remove unneeded labels
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v1 40/59] hsb/hcd-ehci.c: remove unneeded labels |
Date: |
Mon, 6 Jan 2020 15:24:06 -0300 |
Label 'out' in ehci_state_fetchentry(), ehci_state_waitlisthead(),
ehci_state_fetchqh() and ehci_state_execute() can be replaced
by 'return' with the appropriate value.
CC: Gerd Hoffmann <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
hw/usb/hcd-ehci.c | 32 ++++++++++----------------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 56ab2f457f..d8103102d6 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1511,7 +1511,6 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int
async)
{
EHCIqh qh;
int i = 0;
- int again = 0;
uint32_t entry = ehci->asynclistaddr;
/* set reclamation flag at start event (4.8.6) */
@@ -1536,8 +1535,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int
async)
ehci_set_fetch_addr(ehci, async, entry);
ehci_set_state(ehci, async, EST_FETCHENTRY);
- again = 1;
- goto out;
+ return 1;
}
entry = qh.next;
@@ -1550,8 +1548,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int
async)
ehci_set_state(ehci, async, EST_ACTIVE);
-out:
- return again;
+ return 0;
}
@@ -1565,7 +1562,7 @@ static int ehci_state_fetchentry(EHCIState *ehci, int
async)
if (NLPTR_TBIT(entry)) {
ehci_set_state(ehci, async, EST_ACTIVE);
- goto out;
+ return 0;
}
/* section 4.8, only QH in async schedule */
@@ -1597,7 +1594,6 @@ static int ehci_state_fetchentry(EHCIState *ehci, int
async)
return -1;
}
-out:
return again;
}
@@ -1617,14 +1613,12 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci,
int async)
if (q->seen > 1) {
/* we are going in circles -- stop processing */
ehci_set_state(ehci, async, EST_ACTIVE);
- q = NULL;
- goto out;
+ return NULL;
}
if (get_dwords(ehci, NLPTR_GET(q->qhaddr),
(uint32_t *) &qh, sizeof(EHCIqh) >> 2) < 0) {
- q = NULL;
- goto out;
+ return NULL;
}
ehci_trace_qh(q, NLPTR_GET(q->qhaddr), &qh);
@@ -1658,8 +1652,7 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int
async)
DPRINTF("FETCHQH: QH 0x%08x. H-bit set, reclamation status reset"
" - done processing\n", q->qhaddr);
ehci_set_state(ehci, async, EST_ACTIVE);
- q = NULL;
- goto out;
+ return NULL;
}
}
@@ -1688,7 +1681,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int
async)
ehci_set_state(ehci, async, EST_ADVANCEQUEUE);
}
-out:
return q;
}
@@ -1932,8 +1924,7 @@ static int ehci_state_execute(EHCIQueue *q)
/* 4.10.3, bottom of page 82, go horizontal on transaction counter == 0 */
if (!q->async && q->transact_ctr == 0) {
ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH);
- again = 1;
- goto out;
+ return 1;
}
if (q->async) {
@@ -1942,7 +1933,7 @@ static int ehci_state_execute(EHCIQueue *q)
again = ehci_execute(p, "process");
if (again == -1) {
- goto out;
+ return -1;
}
if (p->packet.status == USB_RET_ASYNC) {
ehci_flush_qh(q);
@@ -1954,14 +1945,11 @@ static int ehci_state_execute(EHCIQueue *q)
} else {
again = 1;
}
- goto out;
+ return again;
}
ehci_set_state(q->ehci, q->async, EST_EXECUTING);
- again = 1;
-
-out:
- return again;
+ return 1;
}
static int ehci_state_executing(EHCIQueue *q)
--
2.24.1
- [PATCH v1 25/59] block/vhdx.c: remove unneeded 'exit' labels, (continued)
- [PATCH v1 25/59] block/vhdx.c: remove unneeded 'exit' labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 29/59] cryptodev-vhost.c: remove unneeded 'err' label in cryptodev_vhost_start, Daniel Henrique Barboza, 2020/01/06
- [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 <=
- [PATCH v1 43/59] i386/amd_iommu.c: remove unneeded label in amdvi_int_remap_msi(), Daniel Henrique Barboza, 2020/01/06
- [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