From patchwork Fri Oct 2 20:15:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 34886 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 56610B7BBE for ; Sat, 3 Oct 2009 06:25:18 +1000 (EST) Received: from localhost ([127.0.0.1]:37472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mtogl-00084A-Dx for incoming@patchwork.ozlabs.org; Fri, 02 Oct 2009 16:25:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtoZr-0004OT-7C for qemu-devel@nongnu.org; Fri, 02 Oct 2009 16:18:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtoZj-0004KL-7j for qemu-devel@nongnu.org; Fri, 02 Oct 2009 16:18:05 -0400 Received: from [199.232.76.173] (port=46063 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtoZi-0004KA-UQ for qemu-devel@nongnu.org; Fri, 02 Oct 2009 16:17:58 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:43755) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtoZi-0000hH-AY for qemu-devel@nongnu.org; Fri, 02 Oct 2009 16:17:58 -0400 Received: from nm.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with ESMTP id AB92E49D0D; Sat, 3 Oct 2009 05:17:55 +0900 (JST) Received: from yamahata by nm.local.valinux.co.jp with local (Exim 4.69) (envelope-from ) id 1MtoY6-00038U-Cs; Sat, 03 Oct 2009 05:16:18 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org, anthony@codemonkey.ws Date: Sat, 3 Oct 2009 05:15:57 +0900 Message-Id: <1254514577-11896-6-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1254514577-11896-1-git-send-email-yamahata@valinux.co.jp> References: <1254514577-11896-1-git-send-email-yamahata@valinux.co.jp> X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH 05/25] pci: use PCI_SLOT() and PCI_FUNC(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org use PCI_SLOT() and PCI_FUNC() where appropriate instead of direct use of bit operation. Signed-off-by: Isaku Yamahata Acked-by: Michael S. Tsirkin --- hw/pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 1016893..3bbc7e3 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -703,7 +703,7 @@ static void pci_info_device(PCIDevice *d) const pci_class_desc *desc; monitor_printf(mon, " Bus %2d, device %3d, function %d:\n", - d->bus->bus_num, d->devfn >> 3, d->devfn & 7); + d->bus->bus_num, PCI_SLOT(d->devfn), PCI_FUNC(d->devfn)); class = le16_to_cpu(*((uint16_t *)(d->config + PCI_CLASS_DEVICE))); monitor_printf(mon, " "); desc = pci_class_descriptions; @@ -1039,7 +1039,7 @@ static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent) monitor_printf(mon, "%*sclass %s, addr %02x:%02x.%x, " "pci id %04x:%04x (sub %04x:%04x)\n", indent, "", ctxt, - d->bus->bus_num, d->devfn >> 3, d->devfn & 7, + d->bus->bus_num, PCI_SLOT(d->devfn), PCI_FUNC(d->devfn), le16_to_cpu(*((uint16_t *)(d->config + PCI_VENDOR_ID))), le16_to_cpu(*((uint16_t *)(d->config + PCI_DEVICE_ID))), le16_to_cpu(*((uint16_t *)(d->config + PCI_SUBSYSTEM_VENDOR_ID))),