From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WHF-00056f-UF for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:13:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9WGv-0006T3-2d for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:13:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WGu-0006Rt-Qs for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:13:04 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q867D4f2003699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Sep 2012 03:13:04 -0400 From: Gerd Hoffmann Date: Thu, 6 Sep 2012 09:12:49 +0200 Message-Id: <1346915575-12369-49-git-send-email-kraxel@redhat.com> In-Reply-To: <1346915575-12369-1-git-send-email-kraxel@redhat.com> References: <1346915575-12369-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 48/54] xhci: move register update into xhci_intr_raise List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Now that we have a separate function to raise an IRQ we can move some comon code into the function. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 3bac99a..e39fe04 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -662,8 +662,11 @@ static void xhci_msix_update(XHCIState *xhci) static void xhci_intr_raise(XHCIState *xhci) { - if (!(xhci->iman & IMAN_IP) || - !(xhci->iman & IMAN_IE)) { + xhci->erdp_low |= ERDP_EHB; + xhci->iman |= IMAN_IP; + xhci->usbsts |= USBSTS_EINT; + + if (!(xhci->iman & IMAN_IE)) { return; } @@ -784,9 +787,6 @@ static void xhci_events_update(XHCIState *xhci) } if (do_irq) { - xhci->erdp_low |= ERDP_EHB; - xhci->iman |= IMAN_IP; - xhci->usbsts |= USBSTS_EINT; xhci_intr_raise(xhci); } @@ -847,10 +847,6 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event) xhci_write_event(xhci, event); } - xhci->erdp_low |= ERDP_EHB; - xhci->iman |= IMAN_IP; - xhci->usbsts |= USBSTS_EINT; - xhci_intr_raise(xhci); } -- 1.7.1