[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/55] display/vmware_vga: QOM casting sweep
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 21/55] display/vmware_vga: QOM casting sweep |
Date: |
Tue, 23 Jul 2013 01:46:02 +0200 |
From: Peter Crosthwaite <address@hidden>
Define and use standard QOM cast macro. Remove usages of DO_UPCAST() and
direct -> style casting.
Signed-off-by: Peter Crosthwaite <address@hidden>
[AF: Renamed to TYPE_VMWARE_VGA and VMWARE_VGA()]
Signed-off-by: Andreas Färber <address@hidden>
---
hw/display/vmware_vga.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 714908f..32637e7 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -81,6 +81,11 @@ struct vmsvga_state_s {
int redraw_fifo_first, redraw_fifo_last;
};
+#define TYPE_VMWARE_SVGA "vmware-svga"
+
+#define VMWARE_SVGA(obj) \
+ OBJECT_CHECK(struct pci_vmsvga_state_s, (obj), TYPE_VMWARE_SVGA)
+
struct pci_vmsvga_state_s {
PCIDevice card;
struct vmsvga_state_s chip;
@@ -1092,8 +1097,7 @@ static void vmsvga_update_display(void *opaque)
static void vmsvga_reset(DeviceState *dev)
{
- struct pci_vmsvga_state_s *pci =
- DO_UPCAST(struct pci_vmsvga_state_s, card.qdev, dev);
+ struct pci_vmsvga_state_s *pci = VMWARE_SVGA(dev);
struct vmsvga_state_s *s = &pci->chip;
s->index = 0;
@@ -1250,8 +1254,7 @@ static const MemoryRegionOps vmsvga_io_ops = {
static int pci_vmsvga_initfn(PCIDevice *dev)
{
- struct pci_vmsvga_state_s *s =
- DO_UPCAST(struct pci_vmsvga_state_s, card, dev);
+ struct pci_vmsvga_state_s *s = VMWARE_SVGA(dev);
s->card.config[PCI_CACHE_LINE_SIZE] = 0x08; /* Cache line size */
s->card.config[PCI_LATENCY_TIMER] = 0x40; /* Latency timer */
@@ -1303,7 +1306,7 @@ static void vmsvga_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo vmsvga_info = {
- .name = "vmware-svga",
+ .name = TYPE_VMWARE_SVGA,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(struct pci_vmsvga_state_s),
.class_init = vmsvga_class_init,
--
1.8.1.4
- [Qemu-devel] [PULL 13/55] scsi/esp-pci: QOM Upcast Sweep, (continued)
- [Qemu-devel] [PULL 13/55] scsi/esp-pci: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 08/55] usb/hcd-xhci: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 10/55] scsi/lsi53c895a: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [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 <=
- [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, 2013/07/22
- [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