[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 06/30] scsi/megasas: QOM Upcast Sweep
From: |
peter . crosthwaite |
Subject: |
[Qemu-devel] [PATCH v2 06/30] scsi/megasas: QOM Upcast Sweep |
Date: |
Mon, 24 Jun 2013 16:54:15 +1000 |
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>
---
hw/scsi/megasas.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 65ccb09..49fcae4 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -108,6 +108,11 @@ typedef struct MegasasState {
SCSIBus bus;
} MegasasState;
+#define TYPE_MEGASAS "megasas"
+
+#define MEGASAS(obj) \
+ OBJECT_CHECK(MegasasState, (obj), TYPE_MEGASAS)
+
#define MEGASAS_INTR_DISABLED_MASK 0xFFFFFFFF
static bool megasas_intr_enabled(MegasasState *s)
@@ -2039,7 +2044,7 @@ static void megasas_soft_reset(MegasasState *s)
static void megasas_scsi_reset(DeviceState *dev)
{
- MegasasState *s = DO_UPCAST(MegasasState, dev.qdev, dev);
+ MegasasState *s = MEGASAS(dev);
megasas_soft_reset(s);
}
@@ -2064,7 +2069,7 @@ static const VMStateDescription vmstate_megasas = {
static void megasas_scsi_uninit(PCIDevice *d)
{
- MegasasState *s = DO_UPCAST(MegasasState, dev, d);
+ MegasasState *s = MEGASAS(d);
#ifdef USE_MSIX
msix_uninit(&s->dev, &s->mmio_io);
@@ -2087,7 +2092,7 @@ static const struct SCSIBusInfo megasas_scsi_info = {
static int megasas_scsi_init(PCIDevice *dev)
{
- MegasasState *s = DO_UPCAST(MegasasState, dev, dev);
+ MegasasState *s = MEGASAS(dev);
uint8_t *pci_conf;
int i, bar_type;
@@ -2158,7 +2163,7 @@ static int megasas_scsi_init(PCIDevice *dev)
s->frames[i].state = s;
}
- scsi_bus_new(&s->bus, &dev->qdev, &megasas_scsi_info, NULL);
+ scsi_bus_new(&s->bus, DEVICE(dev), &megasas_scsi_info, NULL);
scsi_bus_legacy_handle_cmdline(&s->bus);
return 0;
}
@@ -2198,7 +2203,7 @@ static void megasas_class_init(ObjectClass *oc, void
*data)
}
static const TypeInfo megasas_info = {
- .name = "megasas",
+ .name = TYPE_MEGASAS,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(MegasasState),
.class_init = megasas_class_init,
--
1.8.3.rc1.44.gb387c77.dirty
- [Qemu-devel] [PATCH qom-next] net/rtl8139: QOM parent field cleanup, (continued)
- [Qemu-devel] [PATCH v2 03/30] net/pcnet-pci: QOM Upcast Sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 04/30] usb/hcd-xhci: QOM Upcast Sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 05/30] scsi/lsi53c895a: QOM Upcast Sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 06/30] scsi/megasas: QOM Upcast Sweep,
peter . crosthwaite <=
- [Qemu-devel] [PATCH v2 07/30] scsi/esp-pci: QOM Upcast Sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 08/30] ide/ich: QOM Upcast Sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 09/30] ide/piix: QOM casting sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 10/30] acpi/piix4: QOM Upcast Sweep, peter . crosthwaite, 2013/06/24