From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoqYx-0002l3-VO for qemu-devel@nongnu.org; Mon, 26 May 2014 04:47:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WoqYr-0002ak-R9 for qemu-devel@nongnu.org; Mon, 26 May 2014 04:47:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoqYr-0002aa-JI for qemu-devel@nongnu.org; Mon, 26 May 2014 04:47:13 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4Q8lCUW025111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 26 May 2014 04:47:13 -0400 From: Gerd Hoffmann Date: Mon, 26 May 2014 10:47:00 +0200 Message-Id: <1401094027-5275-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1401094027-5275-1-git-send-email-kraxel@redhat.com> References: <1401094027-5275-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 03/10] xhci: add xhci_get_flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index a203bc6..54dea16 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -621,6 +621,11 @@ static const char *ep_state_name(uint32_t state) ARRAY_SIZE(ep_state_names)); } +static bool xhci_get_flag(XHCIState *xhci, enum xhci_flags bit) +{ + return xhci->flags & (1 << bit); +} + static uint64_t xhci_mfindex_get(XHCIState *xhci) { int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); @@ -3599,10 +3604,10 @@ static int usb_xhci_initfn(struct PCIDevice *dev) assert(ret >= 0); } - if (xhci->flags & (1 << XHCI_FLAG_USE_MSI)) { + if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI)) { msi_init(dev, 0x70, xhci->numintrs, true, false); } - if (xhci->flags & (1 << XHCI_FLAG_USE_MSI_X)) { + if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI_X)) { msix_init(dev, xhci->numintrs, &xhci->mem, 0, OFF_MSIX_TABLE, &xhci->mem, 0, OFF_MSIX_PBA, -- 1.8.3.1