From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GYu-0005YP-TY for qemu-devel@nongnu.org; Wed, 07 Mar 2012 08:05:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5GYa-0008FK-Bg for qemu-devel@nongnu.org; Wed, 07 Mar 2012 08:05:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GYa-0008EQ-3Q for qemu-devel@nongnu.org; Wed, 07 Mar 2012 08:05:28 -0500 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 q27D5Q0H010239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 7 Mar 2012 08:05:26 -0500 From: Gerd Hoffmann Date: Wed, 7 Mar 2012 14:05:09 +0100 Message-Id: <1331125520-13467-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1331125520-13467-1-git-send-email-kraxel@redhat.com> References: <1331125520-13467-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 09/20] usb-ehci: Remove dead nakcnt code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede This patch removes 2 bits of dead nakcnt code: 1) usb_ehci_execute calls ehci_qh_do_overlay which does: nakcnt = reload; and then has a block of code which is conditional on: if (reload && !nakcnt) { which ofcourse is never true now as nakcnt == reload. 2) ehci_state_fetchqh does: nakcnt = reload; but before nakcnt is ever used ehci_state_fetchqh is always followed by a ehci_qh_do_overlay call which also does: nakcnt = reload; So doing this from ehci_state_fetchqh is redundant. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 20 -------------------- 1 files changed, 0 insertions(+), 20 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 2685adc..07bcd1f 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1615,7 +1615,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) { uint32_t entry; EHCIQueue *q; - int reload; entry = ehci_get_fetch_addr(ehci, async); q = ehci_find_queue_by_qh(ehci, entry, async); @@ -1673,11 +1672,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) } #endif - reload = get_field(q->qh.epchar, QH_EPCHAR_RL); - if (reload) { - set_field(&q->qh.altnext_qtd, reload, QH_ALTNEXT_NAKCNT); - } - if (q->qh.token & QTD_TOKEN_HALT) { ehci_set_state(ehci, async, EST_HORIZONTALQH); @@ -1837,25 +1831,11 @@ static void ehci_flush_qh(EHCIQueue *q) static int ehci_state_execute(EHCIQueue *q, int async) { int again = 0; - int reload, nakcnt; - int smask; if (ehci_qh_do_overlay(q) != 0) { return -1; } - smask = get_field(q->qh.epcap, QH_EPCAP_SMASK); - - if (!smask) { - reload = get_field(q->qh.epchar, QH_EPCHAR_RL); - nakcnt = get_field(q->qh.altnext_qtd, QH_ALTNEXT_NAKCNT); - if (reload && !nakcnt) { - ehci_set_state(q->ehci, async, EST_HORIZONTALQH); - again = 1; - goto out; - } - } - // TODO verify enough time remains in the uframe as in 4.4.1.1 // TODO write back ptr to async list when done or out of time // TODO Windows does not seem to ever set the MULT field -- 1.7.1