[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/55] xen/xen_platform: QOM casting sweep
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 25/55] xen/xen_platform: QOM casting sweep |
Date: |
Tue, 23 Jul 2013 01:46:06 +0200 |
From: Peter Crosthwaite <address@hidden>
Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.
Signed-off-by: Peter Crosthwaite <address@hidden>
[AF: Dropped opaque casts]
Signed-off-by: Andreas Färber <address@hidden>
---
hw/xen/xen_platform.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/hw/xen/xen_platform.c b/hw/xen/xen_platform.c
index 15d7cf0..52a7279 100644
--- a/hw/xen/xen_platform.c
+++ b/hw/xen/xen_platform.c
@@ -62,6 +62,10 @@ typedef struct PCIXenPlatformState {
int log_buffer_off;
} PCIXenPlatformState;
+#define TYPE_XEN_PLATFORM "xen-platform"
+#define XEN_PLATFORM(obj) \
+ OBJECT_CHECK(PCIXenPlatformState, (obj), TYPE_XEN_PLATFORM)
+
#define XEN_PLATFORM_IOPORT 0x10
/* Send bytes to syslog */
@@ -88,7 +92,7 @@ static void unplug_nic(PCIBus *b, PCIDevice *d, void *o)
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
PCI_CLASS_NETWORK_ETHERNET
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
- qdev_free(&d->qdev);
+ qdev_free(DEVICE(d));
}
}
@@ -103,7 +107,7 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *o)
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
PCI_CLASS_STORAGE_IDE
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
- qdev_unplug(&(d->qdev), NULL);
+ qdev_unplug(DEVICE(d), NULL);
}
}
@@ -376,7 +380,7 @@ static const VMStateDescription vmstate_xen_platform = {
static int xen_platform_initfn(PCIDevice *dev)
{
- PCIXenPlatformState *d = DO_UPCAST(PCIXenPlatformState, pci_dev, dev);
+ PCIXenPlatformState *d = XEN_PLATFORM(dev);
uint8_t *pci_conf;
pci_conf = d->pci_dev.config;
@@ -402,7 +406,7 @@ static int xen_platform_initfn(PCIDevice *dev)
static void platform_reset(DeviceState *dev)
{
- PCIXenPlatformState *s = DO_UPCAST(PCIXenPlatformState, pci_dev.qdev, dev);
+ PCIXenPlatformState *s = XEN_PLATFORM(dev);
platform_fixed_ioport_reset(s);
}
@@ -425,7 +429,7 @@ static void xen_platform_class_init(ObjectClass *klass,
void *data)
}
static const TypeInfo xen_platform_info = {
- .name = "xen-platform",
+ .name = TYPE_XEN_PLATFORM,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCIXenPlatformState),
.class_init = xen_platform_class_init,
--
1.8.1.4
- [Qemu-devel] [PULL 14/55] scsi/esp-pci: QOM parent field cleanup, (continued)
- [Qemu-devel] [PULL 14/55] scsi/esp-pci: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 16/55] ide/ich: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 15/55] ide/ich: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 17/55] acpi/piix4: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 19/55] misc/pci-testdev: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 20/55] misc/pci-testdev: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 18/55] acpi/piix4: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 21/55] display/vmware_vga: QOM casting sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 22/55] display/vmware_vga: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 23/55] misc/ivshmem: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 25/55] xen/xen_platform: QOM casting sweep,
Andreas Färber <=
- [Qemu-devel] [PULL 26/55] xen/xen_platform: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 27/55] sysbus: Document SysBusDeviceClass::init and realize semantics, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 24/55] misc/ivshmem: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 29/55] ohci: Use QOM realize for OHCI, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 28/55] ohci: QOM'ify some more, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 31/55] i440fx-pcihost: Use QOM realize for i440fx-pcihost, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 33/55] q35: Use QOM realize for q35 host bridge, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 30/55] i440fx: Use type-safe cast instead of direct access of parent dev, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 35/55] pflash-cfi01: QOM'ify some more, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 34/55] fdc: QOM'ify some more, Andreas Färber, 2013/07/22