From nobody Mon Feb 9 08:50:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642340551942322.1869531443705; Sun, 16 Jan 2022 05:42:31 -0800 (PST) Received: from localhost ([::1]:55590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n95ni-0003OG-HM for importer@patchew.org; Sun, 16 Jan 2022 08:42:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n95im-0000je-CR for qemu-devel@nongnu.org; Sun, 16 Jan 2022 08:37:24 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]:53165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n95ik-0001h5-2T for qemu-devel@nongnu.org; Sun, 16 Jan 2022 08:37:23 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id ABEBA7470C9; Sun, 16 Jan 2022 14:37:19 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 3EE447470BB; Sun, 16 Jan 2022 14:37:19 +0100 (CET) Message-Id: <291c729fb55d31b9291d25353dbae29bc93430ed.1642339238.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 2/5] usb/ohci: Move cancelling async packet to ohci_stop_endpoints() Date: Sun, 16 Jan 2022 14:20:40 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org X-Spam-Probability: 8% 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; Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1642340553590100001 Content-Type: text/plain; charset="utf-8" This is always done before calling this function so remove duplicated code and do it within the function at one place. Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ohci.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index f915cc5473..6d762973eb 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -369,6 +369,10 @@ void ohci_stop_endpoints(OHCIState *ohci) USBDevice *dev; int i, j; =20 + if (ohci->async_td) { + usb_cancel_packet(&ohci->usb_packet); + ohci->async_td =3D 0; + } for (i =3D 0; i < ohci->num_ports; i++) { dev =3D ohci->rhport[i].port.dev; if (dev && dev->attached) { @@ -398,10 +402,6 @@ static void ohci_roothub_reset(OHCIState *ohci) usb_port_reset(&port->port); } } - if (ohci->async_td) { - usb_cancel_packet(&ohci->usb_packet); - ohci->async_td =3D 0; - } ohci_stop_endpoints(ohci); } =20 @@ -1277,10 +1277,6 @@ static void ohci_frame_boundary(void *opaque) =20 /* Cancel all pending packets if either of the lists has been disabled= . */ if (ohci->old_ctl & (~ohci->ctl) & (OHCI_CTL_BLE | OHCI_CTL_CLE)) { - if (ohci->async_td) { - usb_cancel_packet(&ohci->usb_packet); - ohci->async_td =3D 0; - } ohci_stop_endpoints(ohci); } ohci->old_ctl =3D ohci->ctl; --=20 2.30.2