From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MuNwr-0004GE-DA for qemu-devel@nongnu.org; Sun, 04 Oct 2009 06:04:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MuNwm-0004DC-Hg for qemu-devel@nongnu.org; Sun, 04 Oct 2009 06:04:11 -0400 Received: from [199.232.76.173] (port=55080 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MuNwl-0004D3-6g for qemu-devel@nongnu.org; Sun, 04 Oct 2009 06:04:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38839) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MuNwk-0001Ki-Cn for qemu-devel@nongnu.org; Sun, 04 Oct 2009 06:04:06 -0400 Date: Sun, 4 Oct 2009 12:02:04 +0200 From: "Michael S. Tsirkin" Message-ID: <20091004100204.GG16887@redhat.com> References: <1254514577-11896-1-git-send-email-yamahata@valinux.co.jp> <1254514577-11896-6-git-send-email-yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1254514577-11896-6-git-send-email-yamahata@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH 05/25] pci: use PCI_SLOT() and PCI_FUNC(). List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Sat, Oct 03, 2009 at 05:15:57AM +0900, Isaku Yamahata wrote: > 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))), > -- > 1.6.0.2 > >