Patchwork [03/32] qdev/prop: convert pci.c to helper macros.

login
register
mail settings
Submitter Gerd Hoffmann
Date Aug. 3, 2009, 3:35 p.m.
Message ID <1249313748-6459-4-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/30611/
State Superseded
Headers show

Comments

Gerd Hoffmann - Aug. 3, 2009, 3:35 p.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pci.c |    9 ++-------
 hw/pci.h |    2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)

Patch

diff --git a/hw/pci.c b/hw/pci.c
index 4d0cdc7..27eac04 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -60,13 +60,8 @@  static struct BusInfo pci_bus_info = {
     .size       = sizeof(PCIBus),
     .print_dev  = pcibus_dev_print,
     .props      = (Property[]) {
-        {
-            .name   = "addr",
-            .info   = &qdev_prop_pci_devfn,
-            .offset = offsetof(PCIDevice, devfn),
-            .defval = (uint32_t[]) { -1 },
-        },
-        {/* end of list */}
+        DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
+        DEFINE_PROP_END_OF_LIST()
     }
 };
 
diff --git a/hw/pci.h b/hw/pci.h
index cbfea6a..a2ec16a 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -177,7 +177,7 @@  struct PCIDevice {
 
     /* the following fields are read only */
     PCIBus *bus;
-    int devfn;
+    uint32_t devfn;
     char name[64];
     PCIIORegion io_regions[PCI_NUM_REGIONS];