diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2009-10-30 21:20:57 +0900 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-11-09 08:43:04 -0600 |
commit | 2217dcfff5e24a16217cba5e53c3579f97d8880e (patch) | |
tree | a5e05980d3e68b55c0a12c1cc24d0f821721f3b2 /hw/pci.c | |
parent | e369cad7cd574d6d7e680ccd4d3227de7d1a0135 (diff) |
pci: use PCI_SLOT() and PCI_FUNC().
use PCI_SLOT() and PCI_FUNC() where appropriate instead of
direct use of bit operation.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r-- | hw/pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -745,7 +745,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; @@ -1111,7 +1111,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))), |