From patchwork Fri Aug 17 09:39:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 178177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B1B2C2C008D for ; Fri, 17 Aug 2012 19:38:38 +1000 (EST) Received: from localhost ([::1]:44436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2J0m-0002cY-Rb for incoming@patchwork.ozlabs.org; Fri, 17 Aug 2012 05:38:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2J0a-0002SJ-9O for qemu-devel@nongnu.org; Fri, 17 Aug 2012 05:38:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2J0U-0002Ie-Ak for qemu-devel@nongnu.org; Fri, 17 Aug 2012 05:38:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2J0U-0002IL-36 for qemu-devel@nongnu.org; Fri, 17 Aug 2012 05:38:18 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7H9cHlH031337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Aug 2012 05:38:17 -0400 Received: from shalem.localdomain.com (vpn1-6-112.ams2.redhat.com [10.36.6.112]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7H9cDJE007975; Fri, 17 Aug 2012 05:38:16 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Fri, 17 Aug 2012 11:39:17 +0200 Message-Id: <1345196357-6076-3-git-send-email-hdegoede@redhat.com> In-Reply-To: <1345196357-6076-1-git-send-email-hdegoede@redhat.com> References: <1345196357-6076-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 3/3] ehci: simplify ehci_state_executing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org ehci_state_executing does not need to check for p->usb_status == USB_RET_ASYNC or USB_RET_PROCERR, since ehci_execute_complete already does a similar check and will trigger an assert if either value is encountered. USB_RET_ASYNC should never be the packet status when execute_complete runs for obvious reasons, and USB_RET_PROCERR is only used by ehci_state_execute / ehci_execute not by ehci_state_executing / ehci_execute_complete. Signed-off-by: Hans de Goede --- hw/usb/hcd-ehci.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 4750175..378b42b 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2070,19 +2070,11 @@ out: static int ehci_state_executing(EHCIQueue *q) { EHCIPacket *p = QTAILQ_FIRST(&q->packets); - int again = 0; assert(p != NULL); assert(p->qtdaddr == q->qtdaddr); ehci_execute_complete(q); - if (p->usb_status == USB_RET_ASYNC) { - goto out; - } - if (p->usb_status == USB_RET_PROCERR) { - again = -1; - goto out; - } // 4.10.3 if (!q->async) { @@ -2100,11 +2092,8 @@ static int ehci_state_executing(EHCIQueue *q) ehci_set_state(q->ehci, q->async, EST_WRITEBACK); } - again = 1; - -out: ehci_flush_qh(q); - return again; + return 1; }