From nobody Sun Feb 8 12:39:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578336962; cv=none; d=zohomail.com; s=zohoarc; b=lx0t4XbdoxANW7hzbAwiRgMFBAUfR+l0cqJu5hkNMDzjrjqjaPnBye4Ik76DOLCJPraa0I5Rwsi6z9zHpHG0sHy39yU6SfHSj1Ae/ABJWZtMZfWTa0L0R1b2IHb8dKGJc9iNSq2eyzV8fdUdI4QvyeJfrQBJGYuiDBvhDSQs/fE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578336962; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jkWrhgPSptvUdoRpBvu+nZPt4DG/CCW6P9e4SvO3R4Y=; b=Hh2v0difKgJ2fQtkUcW/ggzinVxiH/svU2Wy6ms1bf9OfCRL6hOs1MQJtBlcNMWWhB/LkL/ckANPbH5Kf1yWBoqmAWKXEHMuhGyEmceLps/B+7hGm6EyVHjZoe5eUR4KEM9qwA9Fagw1f/xqva5D2CVoh9XJVpVKqMF854YVSYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578336962298489.43680607478836; Mon, 6 Jan 2020 10:56:02 -0800 (PST) Received: from localhost ([::1]:58150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXXk-0007qD-O2 for importer@patchew.org; Mon, 06 Jan 2020 13:56:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46148) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4o-00039p-NI for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4n-0004qu-6L for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:06 -0500 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:41709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4n-0004qX-2V; Mon, 06 Jan 2020 13:26:05 -0500 Received: by mail-qt1-x842.google.com with SMTP id k40so43186289qtk.8; Mon, 06 Jan 2020 10:26:05 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jkWrhgPSptvUdoRpBvu+nZPt4DG/CCW6P9e4SvO3R4Y=; b=PpUVHzsymhP0qmvWWvSH988bOE8R/TWD2utS/aX3eog494DPlrx06/rLaIj/20bdOD 5cw7BvX+je2pcnvWwYaAt0BlnD8JeZEhq4YaZ2fjSBW0E+Aq/GrFCHEcEDTNyLogntj1 4LgtKWaFgsSfXKgXLvi5hnn4YuWWrd89zF2VI8qK0yFs3EKSllP9i35mywAVXz4knxtK /ZoIxnj2xzEYMgDe8c5ThzuPJd+M4atCl3zbtmXUaA0o0mDwkqGPo3Zxet287hcMM0m9 cL8S0bQwL4eYsHUxhEDrEH3nEp23MUUNQzwb9N+Div5n48JnD3bFUbKI25aWssVDp7/3 fhOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jkWrhgPSptvUdoRpBvu+nZPt4DG/CCW6P9e4SvO3R4Y=; b=uKzQZEN4LUMYBF2rPtnWCNxrIqPduI4FaE2HSd3EGPiS/Y8my5Cpjvy9o/S4VS0YS3 idh/NHfHFjHHP08DWLXC+xv7m6vmuRgtYf6FN0HTcHVlCZt7BSbn+By8S95BzOOjJXZK BUNmhbglhaBFe090MoCY7HD4I7NMBmME+mYI80jtUfbXK/q7Z9S2BTYc6y3m+TZCOYbV zj0yG0tW3FebmarxqT5Ayzj0N5643wMFurkAb6D7A/UubE4aBGmzftdcPB0gHejsjjK6 vtSVLcuWVTZOPmPV5H11TcaF+AhLOqjVOqTtEw9XY2kkOnrqvN9aTzyHV8E2U1y6p6br JR7A== X-Gm-Message-State: APjAAAWR+HatDfD6WYQuILLeeLlmM2u7shvghX4IQ1bm9PIerm5SYl20 DJEJXYMfu//IXlBkh1e1RPGM9uVe X-Google-Smtp-Source: APXvYqyfAVd/QYltAIZUHmuLgfKU7232NaaldQUa3oK+LsgJIaAp0wBAPCDwRaSixBJh8RVGfnZ/Eg== X-Received: by 2002:ac8:404e:: with SMTP id j14mr67129587qtl.312.1578335164489; Mon, 06 Jan 2020 10:26:04 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 40/59] hsb/hcd-ehci.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:06 -0300 Message-Id: <20200106182425.20312-41-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Daniel Henrique Barboza --- 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 =3D 0; - int again =3D 0; uint32_t entry =3D ehci->asynclistaddr; =20 /* set reclamation flag at start event (4.8.6) */ @@ -1536,8 +1535,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, = int async) =20 ehci_set_fetch_addr(ehci, async, entry); ehci_set_state(ehci, async, EST_FETCHENTRY); - again =3D 1; - goto out; + return 1; } =20 entry =3D qh.next; @@ -1550,8 +1548,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, = int async) =20 ehci_set_state(ehci, async, EST_ACTIVE); =20 -out: - return again; + return 0; } =20 =20 @@ -1565,7 +1562,7 @@ static int ehci_state_fetchentry(EHCIState *ehci, int= async) =20 if (NLPTR_TBIT(entry)) { ehci_set_state(ehci, async, EST_ACTIVE); - goto out; + return 0; } =20 /* section 4.8, only QH in async schedule */ @@ -1597,7 +1594,6 @@ static int ehci_state_fetchentry(EHCIState *ehci, int= async) return -1; } =20 -out: return again; } =20 @@ -1617,14 +1613,12 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehc= i, int async) if (q->seen > 1) { /* we are going in circles -- stop processing */ ehci_set_state(ehci, async, EST_ACTIVE); - q =3D NULL; - goto out; + return NULL; } =20 if (get_dwords(ehci, NLPTR_GET(q->qhaddr), (uint32_t *) &qh, sizeof(EHCIqh) >> 2) < 0) { - q =3D NULL; - goto out; + return NULL; } ehci_trace_qh(q, NLPTR_GET(q->qhaddr), &qh); =20 @@ -1658,8 +1652,7 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci,= int async) DPRINTF("FETCHQH: QH 0x%08x. H-bit set, reclamation status re= set" " - done processing\n", q->qhaddr); ehci_set_state(ehci, async, EST_ACTIVE); - q =3D NULL; - goto out; + return NULL; } } =20 @@ -1688,7 +1681,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci,= int async) ehci_set_state(ehci, async, EST_ADVANCEQUEUE); } =20 -out: return q; } =20 @@ -1932,8 +1924,7 @@ static int ehci_state_execute(EHCIQueue *q) /* 4.10.3, bottom of page 82, go horizontal on transaction counter =3D= =3D 0 */ if (!q->async && q->transact_ctr =3D=3D 0) { ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH); - again =3D 1; - goto out; + return 1; } =20 if (q->async) { @@ -1942,7 +1933,7 @@ static int ehci_state_execute(EHCIQueue *q) =20 again =3D ehci_execute(p, "process"); if (again =3D=3D -1) { - goto out; + return -1; } if (p->packet.status =3D=3D USB_RET_ASYNC) { ehci_flush_qh(q); @@ -1954,14 +1945,11 @@ static int ehci_state_execute(EHCIQueue *q) } else { again =3D 1; } - goto out; + return again; } =20 ehci_set_state(q->ehci, q->async, EST_EXECUTING); - again =3D 1; - -out: - return again; + return 1; } =20 static int ehci_state_executing(EHCIQueue *q) --=20 2.24.1