Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2228014/?format=api
{ "id": 2228014, "url": "http://patchwork.ozlabs.org/api/patches/2228014/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424192543.22614-9-philmd@linaro.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260424192543.22614-9-philmd@linaro.org>", "list_archive_url": null, "date": "2026-04-24T19:25:40", "name": "[PULL,v4,52/62] hw/usb/hcd-ehci.c: Fix coding style issues reported by checkpatch", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "daf1723a8e301b7035b22c68307c15a424301c36", "submitter": { "id": 85046, "url": "http://patchwork.ozlabs.org/api/people/85046/?format=api", "name": "Philippe Mathieu-Daudé", "email": "philmd@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424192543.22614-9-philmd@linaro.org/mbox/", "series": [ { "id": 501401, "url": "http://patchwork.ozlabs.org/api/series/501401/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501401", "date": "2026-04-24T19:25:34", "name": null, "version": 4, "mbox": "http://patchwork.ozlabs.org/series/501401/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228014/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228014/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=zxyX3UTJ;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2NJD4q8lz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 05:27:08 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wGMAp-0003mc-9y; Fri, 24 Apr 2026 15:26:47 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wGMAn-0003k1-9s\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 15:26:45 -0400", "from mail-wm1-x332.google.com ([2a00:1450:4864:20::332])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wGMAk-0001au-N1\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 15:26:44 -0400", "by mail-wm1-x332.google.com with SMTP id\n 5b1f17b1804b1-488ad135063so73911585e9.0\n for <qemu-devel@nongnu.org>; Fri, 24 Apr 2026 12:26:42 -0700 (PDT)", "from localhost.localdomain (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488fc0f82bbsm1038552865e9.3.2026.04.24.12.26.39\n for <qemu-devel@nongnu.org>\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Fri, 24 Apr 2026 12:26:40 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1777058801; x=1777663601; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n :reply-to; bh=cQYtgOJNWkfs+qrkiY+/t7fLxAFmWUWgMI/v4e5bmLY=;\n b=zxyX3UTJT9IGp7Yz5IKDD4pCL7gdFu53mjciwtC4evigrUN4fFQGb2lQDEwLgTv5U5\n EWkXXdAO9xyQi3ZyTDleet36LafEQBSlr0GNnX0dB+TlcP4wqfMECoLluoBbpurXfsnr\n P01v6nh/c2Bn/RhHF3bJqKJHlrqU5ALB4+BZIP9ImDm/HIsWxaabRRCHNPmSEMY/cPqr\n aRH78um+mInRJCMAINgtdFgJguKrLZ4VVVhUS5spDskFd/CFp2NjhH0n62Bw5fqAOTQc\n 6LRPt8DgcnOH4zcCphazc32hGE4CEx29w9tPBEZ/DssiabLlISrioDJhJXZu0A2TJgw9\n zzDQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777058801; x=1777663601;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=cQYtgOJNWkfs+qrkiY+/t7fLxAFmWUWgMI/v4e5bmLY=;\n b=RIbK3+PT+jti7U2FPaEs8mTCMwQ60LWIi9XuYK9zPorWyrQPW8L+rNB9otIzd3CALK\n z04lXzwFRaSa5T37HMmZkx7hR6o6lXBYl5AqmGZb9ZpURoZD5l0r0iHrV+v+oNTsXRcX\n 7Ni7usVtTI1Weg/m5ojG0ImrfQ8ALq6rvetXmJ423P0RJflRECASJYPuIVLfd6R/SBtw\n MiTlJ9okHwnry0id6hGFbDC3l5xbIl8mme7ofcDcJN27ZfNyx58t2ipGEEzl01frjY5M\n Zq1+ayd1d8z+IXzMnR33nEFbi7QNUol8MKQfkQUENapG9yPktUjidXaCLQwTExOFHGqK\n /V3A==", "X-Gm-Message-State": "AOJu0Yz4Xqz6d/q4JbNJArCchfYviuo6sK6Gb3YPCbdMmpMkhs04Hcev\n MdiFxbhWDWCM2bQVqVr+WgkMOyBW7sHKGsbWMJaD7AsiqolAz8tMLt/YDtm9diF3PLRsKaquy6y\n pwvXlT3A=", "X-Gm-Gg": "AeBDiet8gB0vOXC4RM2RxfI50uY2UIPmYRTQMt4ntRbl/08OwJU0QUzP/OulTuojSOH\n 0WBtzUBNZD6rJ5Kpv/zwIofnxgCIVr5sWK8rvLkfz0Uuz81ezurEam6XauJW+ptoXOySJOxSjHR\n GksgXBPeqG4DDuS4FfbsjghElJ99GOwDFZ/bghpS2L5ChUpeELiY7uSLSa37oxqKqmZq72o289u\n Z+BiiLNIj0NRez0cGfwZKzy9bUSg/IzEpwoSNQ7uotYq6qv0Fpo4dhRbDpGueL+p2kndh4T7Fy9\n h9bvIVpE/Q7B8Mmvvpwxy60W1YCBA0Xdep5FOSrg5H9G+v4TSlfiiR/hR/wXnWskjBOyLeJmNP8\n P6RJB/QcPu1MXe88YueDIT2r/oZiPi9q/LYvaHOyNHXQsF+lgdJC4+OMhi8YLLmdDEG2/Fna7iU\n aS2MHlhMMXb6I72eFWnuVouXyjeUHJgDaXjDXrT6cboeY3lUA+64/WLi5nZvJNK3L61sQjdSGoB\n TSuXrMoQBh2qHy0vDKr3g==", "X-Received": "by 2002:a05:600c:6296:b0:483:64b4:79da with SMTP id\n 5b1f17b1804b1-488fb7923a9mr434667815e9.26.1777058800579;\n Fri, 24 Apr 2026 12:26:40 -0700 (PDT)", "From": "=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>", "To": "qemu-devel@nongnu.org", "Subject": "[PULL v4 52/62] hw/usb/hcd-ehci.c: Fix coding style issues reported\n by checkpatch", "Date": "Fri, 24 Apr 2026 21:25:40 +0200", "Message-ID": "<20260424192543.22614-9-philmd@linaro.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260424192543.22614-1-philmd@linaro.org>", "References": "<20260424192543.22614-1-philmd@linaro.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::332;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "From: Jamin Lin <jamin_lin@aspeedtech.com>\n\nNo functional change.\n\nSigned-off-by: Jamin Lin <jamin_lin@aspeedtech.com>\nReviewed-by: Cédric Le Goater <clg@redhat.com>\nReviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>\nMessage-ID: <20260424080508.53992-5-jamin_lin@aspeedtech.com>\nSigned-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n---\n hw/usb/hcd-ehci.c | 129 +++++++++++++++++++++++++---------------------\n 1 file changed, 71 insertions(+), 58 deletions(-)", "diff": "diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c\nindex 23167bf96f3..7e0b767eb9e 100644\n--- a/hw/usb/hcd-ehci.c\n+++ b/hw/usb/hcd-ehci.c\n@@ -41,21 +41,23 @@\n #define FRAME_TIMER_NS (NANOSECONDS_PER_SECOND / FRAME_TIMER_FREQ)\n #define UFRAME_TIMER_NS (FRAME_TIMER_NS / 8)\n \n-#define NB_MAXINTRATE 8 // Max rate at which controller issues ints\n-#define BUFF_SIZE 5*4096 // Max bytes to transfer per transaction\n-#define MAX_QH 100 // Max allowable queue heads in a chain\n+#define NB_MAXINTRATE 8 /* Max rate at which controller issues ints */\n+#define BUFF_SIZE (5 * 4096) /* Max bytes to transfer per transaction */\n+#define MAX_QH 100 /* Max allowable queue heads in a chain */\n #define MIN_UFR_PER_TICK 24 /* Min frames to process when catching up */\n #define PERIODIC_ACTIVE 512 /* Micro-frames */\n \n-/* Internal periodic / asynchronous schedule state machine states\n+/*\n+ * Internal periodic / asynchronous schedule state machine states\n */\n typedef enum {\n EST_INACTIVE = 1000,\n EST_ACTIVE,\n EST_EXECUTING,\n EST_SLEEPING,\n- /* The following states are internal to the state machine function\n- */\n+ /*\n+ * The following states are internal to the state machine function\n+ */\n EST_WAITLISTHEAD,\n EST_FETCHENTRY,\n EST_FETCHQH,\n@@ -71,13 +73,13 @@ typedef enum {\n /* macros for accessing fields within next link pointer entry */\n #define NLPTR_GET(x) ((x) & 0xffffffe0)\n #define NLPTR_TYPE_GET(x) (((x) >> 1) & 3)\n-#define NLPTR_TBIT(x) ((x) & 1) // 1=invalid, 0=valid\n+#define NLPTR_TBIT(x) ((x) & 1) /* 1=invalid, 0=valid */\n \n /* link pointer types */\n-#define NLPTR_TYPE_ITD 0 // isoc xfer descriptor\n-#define NLPTR_TYPE_QH 1 // queue head\n-#define NLPTR_TYPE_STITD 2 // split xaction, isoc xfer descriptor\n-#define NLPTR_TYPE_FSTN 3 // frame span traversal node\n+#define NLPTR_TYPE_ITD 0 /* isoc xfer descriptor */\n+#define NLPTR_TYPE_QH 1 /* queue head */\n+#define NLPTR_TYPE_STITD 2 /* split xaction, isoc xfer descriptor */\n+#define NLPTR_TYPE_FSTN 3 /* frame span traversal node */\n \n #define SET_LAST_RUN_CLOCK(s) \\\n (s)->last_run_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);\n@@ -88,10 +90,10 @@ typedef enum {\n \n #define set_field(data, newval, field) do { \\\n uint32_t val = *data; \\\n- val &= ~ field##_MASK; \\\n+ val &= ~field##_MASK; \\\n val |= ((newval) << field##_SH) & field##_MASK; \\\n *data = val; \\\n- } while(0)\n+ } while (0)\n \n static const char *ehci_state_names[] = {\n [EST_INACTIVE] = \"INACTIVE\",\n@@ -472,8 +474,10 @@ static bool ehci_verify_pid(EHCIQueue *q, EHCIqtd *qtd)\n }\n }\n \n-/* Finish executing and writeback a packet outside of the regular\n- fetchqh -> fetchqtd -> execute -> writeback cycle */\n+/*\n+ * Finish executing and writeback a packet outside of the regular\n+ * fetchqh -> fetchqtd -> execute -> writeback cycle\n+ */\n static void ehci_writeback_async_complete_packet(EHCIPacket *p)\n {\n EHCIQueue *q = p->queue;\n@@ -733,7 +737,7 @@ static void ehci_detach(USBPort *port)\n ehci_queues_rip_device(s, port->dev, 0);\n ehci_queues_rip_device(s, port->dev, 1);\n \n- *portsc &= ~(PORTSC_CONNECT|PORTSC_PED|PORTSC_SUSPEND);\n+ *portsc &= ~(PORTSC_CONNECT | PORTSC_PED | PORTSC_SUSPEND);\n *portsc |= PORTSC_CSC;\n \n ehci_raise_irq(s, USBSTS_PCD);\n@@ -858,7 +862,7 @@ void ehci_reset(void *opaque)\n * Do the detach before touching portsc, so that it correctly gets send to\n * us or to our companion based on PORTSC_POWNER before the reset.\n */\n- for(i = 0; i < EHCI_PORTS; i++) {\n+ for (i = 0; i < EHCI_PORTS; i++) {\n devs[i] = s->ports[i].dev;\n if (devs[i] && devs[i]->attached) {\n usb_detach(&s->ports[i]);\n@@ -877,7 +881,7 @@ void ehci_reset(void *opaque)\n s->astate = EST_INACTIVE;\n s->pstate = EST_INACTIVE;\n \n- for(i = 0; i < EHCI_PORTS; i++) {\n+ for (i = 0; i < EHCI_PORTS; i++) {\n if (s->companion_ports[i]) {\n s->portsc[i] = PORTSC_POWNER | PORTSC_PPOWER;\n } else {\n@@ -942,8 +946,9 @@ static void handle_port_owner_write(EHCIState *s, int port, uint32_t owner)\n uint32_t *portsc = &s->portsc[port];\n uint32_t orig;\n \n- if (s->companion_ports[port] == NULL)\n+ if (s->companion_ports[port] == NULL) {\n return;\n+ }\n \n owner = owner & PORTSC_POWNER;\n orig = *portsc & PORTSC_POWNER;\n@@ -988,7 +993,7 @@ static void ehci_port_write(void *ptr, hwaddr addr,\n trace_usb_ehci_port_reset(port, 1);\n }\n \n- if (!(val & PORTSC_PRESET) &&(*portsc & PORTSC_PRESET)) {\n+ if (!(val & PORTSC_PRESET) && (*portsc & PORTSC_PRESET)) {\n trace_usb_ehci_port_reset(port, 0);\n if (dev && dev->attached) {\n usb_port_reset(&s->ports[port]);\n@@ -1065,8 +1070,10 @@ static void ehci_opreg_write(void *ptr, hwaddr addr,\n break;\n \n case USBSTS:\n- val &= USBSTS_RO_MASK; // bits 6 through 31 are RO\n- ehci_clear_usbsts(s, val); // bits 0 through 5 are R/WC\n+ /* bits 6 through 31 are RO */\n+ val &= USBSTS_RO_MASK;\n+ /* bits 0 through 5 are R/WC */\n+ ehci_clear_usbsts(s, val);\n val = s->usbsts;\n ehci_update_irq(s);\n break;\n@@ -1131,8 +1138,7 @@ static void ehci_flush_qh(EHCIQueue *q)\n put_dwords(q->ehci, addr + 3 * sizeof(uint32_t), qh + 3, dwords - 3);\n }\n \n-// 4.10.2\n-\n+/* 4.10.2 */\n static int ehci_qh_do_overlay(EHCIQueue *q)\n {\n EHCIPacket *p = QTAILQ_FIRST(&q->packets);\n@@ -1145,8 +1151,7 @@ static int ehci_qh_do_overlay(EHCIQueue *q)\n assert(p != NULL);\n assert(p->qtdaddr == q->qtdaddr);\n \n- // remember values in fields to preserve in qh after overlay\n-\n+ /* remember values in fields to preserve in qh after overlay */\n dtoggle = q->qh.token & QTD_TOKEN_DTOGGLE;\n ping = q->qh.token & QTD_TOKEN_PING;\n \n@@ -1170,7 +1175,7 @@ static int ehci_qh_do_overlay(EHCIQueue *q)\n }\n \n if (!(q->qh.epchar & QH_EPCHAR_DTC)) {\n- // preserve QH DT bit\n+ /* preserve QH DT bit */\n q->qh.token &= ~QTD_TOKEN_DTOGGLE;\n q->qh.token |= dtoggle;\n }\n@@ -1397,9 +1402,7 @@ static int ehci_execute(EHCIPacket *p, const char *action)\n return 1;\n }\n \n-/* 4.7.2\n- */\n-\n+/* 4.7.2 */\n static int ehci_process_itd(EHCIState *ehci,\n EHCIitd *itd,\n uint32_t addr)\n@@ -1411,13 +1414,13 @@ static int ehci_process_itd(EHCIState *ehci,\n \n ehci->periodic_sched_active = PERIODIC_ACTIVE;\n \n- dir =(itd->bufptr[1] & ITD_BUFPTR_DIRECTION);\n+ dir = (itd->bufptr[1] & ITD_BUFPTR_DIRECTION);\n devaddr = get_field(itd->bufptr[0], ITD_BUFPTR_DEVADDR);\n endp = get_field(itd->bufptr[0], ITD_BUFPTR_EP);\n max = get_field(itd->bufptr[1], ITD_BUFPTR_MAXPKT);\n mult = get_field(itd->bufptr[2], ITD_BUFPTR_MULT);\n \n- for(i = 0; i < 8; i++) {\n+ for (i = 0; i < 8; i++) {\n if (itd->transact[i] & ITD_XACT_ACTIVE) {\n pg = get_field(itd->transact[i], ITD_XACT_PGSEL);\n off = itd->transact[i] & ITD_XACT_OFFSET_MASK;\n@@ -1513,8 +1516,9 @@ static int ehci_process_itd(EHCIState *ehci,\n }\n \n \n-/* This state is the entry point for asynchronous schedule\n- * processing. Entry here constitutes a EHCI start event state (4.8.5)\n+/*\n+ * This state is the entry point for asynchronous schedule\n+ * processing. Entry here constitutes a EHCI start event state (4.8.5)\n */\n static int ehci_state_waitlisthead(EHCIState *ehci, int async)\n {\n@@ -1531,7 +1535,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int async)\n ehci_queues_rip_unused(ehci, async);\n \n /* Find the head of the list (4.9.1.1) */\n- for(i = 0; i < MAX_QH; i++) {\n+ for (i = 0; i < MAX_QH; i++) {\n if (get_dwords(ehci, NLPTR_GET(entry), (uint32_t *) &qh,\n sizeof(EHCIqh) >> 2) < 0) {\n return 0;\n@@ -1564,8 +1568,9 @@ out:\n }\n \n \n-/* This state is the entry point for periodic schedule processing as\n- * well as being a continuation state for async processing.\n+/*\n+ * This state is the entry point for periodic schedule processing as\n+ * well as being a continuation state for async processing.\n */\n static int ehci_state_fetchentry(EHCIState *ehci, int async)\n {\n@@ -1674,7 +1679,7 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async)\n \n #if EHCI_DEBUG\n if (q->qhaddr != q->qh.next) {\n- DPRINTF(\"FETCHQH: QH 0x%08x (h %x halt %x active %x) next 0x%08x\\n\",\n+ DPRINTF(\"FETCHQH: QH 0x%08x (h %x halt %x active %x) next 0x%08x\\n\",\n q->qhaddr,\n q->qh.epchar & QH_EPCHAR_H,\n q->qh.token & QTD_TOKEN_HALT,\n@@ -1756,7 +1761,8 @@ static int ehci_state_fetchsitd(EHCIState *ehci, int async)\n /* Section 4.10.2 - paragraph 3 */\n static int ehci_state_advqueue(EHCIQueue *q)\n {\n- /* TO-DO: 4.10.2 - paragraph 2\n+ /*\n+ * TO-DO: 4.10.2 - paragraph 2\n * if I-bit is set to 1 and QH is not active\n * go to horizontal QH\n */\n@@ -1929,8 +1935,10 @@ static int ehci_state_execute(EHCIQueue *q)\n return -1;\n }\n \n- // TODO verify enough time remains in the uframe as in 4.4.1.1\n- // TODO write back ptr to async list when done or out of time\n+ /*\n+ * TODO verify enough time remains in the uframe as in 4.4.1.1\n+ * TODO write back ptr to async list when done or out of time\n+ */\n \n /* 4.10.3, bottom of page 82, go horizontal on transaction counter == 0 */\n if (!q->async && q->transact_ctr == 0) {\n@@ -2041,7 +2049,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)\n int again;\n \n do {\n- switch(ehci_get_state(ehci, async)) {\n+ switch (ehci_get_state(ehci, async)) {\n case EST_WAITLISTHEAD:\n again = ehci_state_waitlisthead(ehci, async);\n break;\n@@ -2120,21 +2128,20 @@ static void ehci_advance_state(EHCIState *ehci, int async)\n ehci_reset(ehci);\n again = 0;\n }\n- }\n- while (again);\n+ } while (again);\n }\n \n static void ehci_advance_async_state(EHCIState *ehci)\n {\n const int async = 1;\n \n- switch(ehci_get_state(ehci, async)) {\n+ switch (ehci_get_state(ehci, async)) {\n case EST_INACTIVE:\n if (!ehci_async_enabled(ehci)) {\n break;\n }\n ehci_set_state(ehci, async, EST_ACTIVE);\n- // No break, fall through to ACTIVE\n+ /* No break, fall through to ACTIVE */\n \n case EST_ACTIVE:\n if (!ehci_async_enabled(ehci)) {\n@@ -2158,7 +2165,8 @@ static void ehci_advance_async_state(EHCIState *ehci)\n ehci_set_state(ehci, async, EST_WAITLISTHEAD);\n ehci_advance_state(ehci, async);\n \n- /* If the doorbell is set, the guest wants to make a change to the\n+ /*\n+ * If the doorbell is set, the guest wants to make a change to the\n * schedule. The host controller needs to release cached data.\n * (section 4.8.2)\n */\n@@ -2185,13 +2193,13 @@ static void ehci_advance_periodic_state(EHCIState *ehci)\n uint32_t list;\n const int async = 0;\n \n- // 4.6\n+ /* 4.6 */\n \n- switch(ehci_get_state(ehci, async)) {\n+ switch (ehci_get_state(ehci, async)) {\n case EST_INACTIVE:\n if (!(ehci->frindex & 7) && ehci_periodic_enabled(ehci)) {\n ehci_set_state(ehci, async, EST_ACTIVE);\n- // No break, fall through to ACTIVE\n+ /* No break, fall through to ACTIVE */\n } else\n break;\n \n@@ -2215,7 +2223,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci)\n \n DPRINTF(\"PERIODIC state adv fr=%d. [%08X] -> %08X\\n\",\n ehci->frindex / 8, list, entry);\n- ehci_set_fetch_addr(ehci, async,entry);\n+ ehci_set_fetch_addr(ehci, async, entry);\n ehci_set_state(ehci, async, EST_FETCHENTRY);\n ehci_advance_state(ehci, async);\n ehci_queues_rip_unused(ehci, async);\n@@ -2240,7 +2248,8 @@ static void ehci_update_frindex(EHCIState *ehci, int uframes)\n ehci_raise_irq(ehci, USBSTS_FLR);\n }\n \n- /* How many times will frindex roll over 0x4000 with this frame count?\n+ /*\n+ * How many times will frindex roll over 0x4000 with this frame count?\n * usbsts_frindex is decremented by 0x4000 on rollover until it reaches 0\n */\n int rollovers = (ehci->frindex + uframes) / 0x4000;\n@@ -2320,8 +2329,9 @@ static void ehci_work_bh(void *opaque)\n ehci->async_stepdown++;\n }\n \n- /* Async is not inside loop since it executes everything it can once\n- * called\n+ /*\n+ * Async is not inside loop since it executes everything it can once\n+ * called\n */\n if (ehci_async_enabled(ehci) || ehci->astate != EST_INACTIVE) {\n need_timer++;\n@@ -2339,15 +2349,18 @@ static void ehci_work_bh(void *opaque)\n }\n \n if (need_timer) {\n- /* If we've raised int, we speed up the timer, so that we quickly\n- * notice any new packets queued up in response */\n+ /*\n+ * If we've raised int, we speed up the timer, so that we quickly\n+ * notice any new packets queued up in response\n+ */\n if (ehci->int_req_by_async && (ehci->usbsts & USBSTS_INT)) {\n expire_time = t_now +\n NANOSECONDS_PER_SECOND / (FRAME_TIMER_FREQ * 4);\n ehci->int_req_by_async = false;\n } else {\n- expire_time = t_now + (NANOSECONDS_PER_SECOND\n- * (ehci->async_stepdown+1) / FRAME_TIMER_FREQ);\n+ expire_time = t_now\n+ + (NANOSECONDS_PER_SECOND * (ehci->async_stepdown + 1) /\n+ FRAME_TIMER_FREQ);\n }\n timer_mod(ehci->frame_timer, expire_time);\n }\n", "prefixes": [ "PULL", "v4", "52/62" ] }