megasas: Rename QOM class cast macros
Rename the MEGASAS_DEVICE_CLASS() and MEGASAS_DEVICE_GET_CLASS() macros to be consistent with the MEGASAS() instance cast macro. This will allow us to register the type cast macros using OBJECT_DECLARE_TYPE later. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Tested-By: Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200825192110.3528606-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
c51325d865
commit
2e0aec1590
|
@ -134,9 +134,9 @@ typedef struct MegasasBaseClass {
|
||||||
#define MEGASAS(obj) \
|
#define MEGASAS(obj) \
|
||||||
OBJECT_CHECK(MegasasState, (obj), TYPE_MEGASAS_BASE)
|
OBJECT_CHECK(MegasasState, (obj), TYPE_MEGASAS_BASE)
|
||||||
|
|
||||||
#define MEGASAS_DEVICE_CLASS(oc) \
|
#define MEGASAS_CLASS(oc) \
|
||||||
OBJECT_CLASS_CHECK(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE)
|
OBJECT_CLASS_CHECK(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE)
|
||||||
#define MEGASAS_DEVICE_GET_CLASS(oc) \
|
#define MEGASAS_GET_CLASS(oc) \
|
||||||
OBJECT_GET_CLASS(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE)
|
OBJECT_GET_CLASS(MegasasBaseClass, (oc), TYPE_MEGASAS_BASE)
|
||||||
|
|
||||||
#define MEGASAS_INTR_DISABLED_MASK 0xFFFFFFFF
|
#define MEGASAS_INTR_DISABLED_MASK 0xFFFFFFFF
|
||||||
|
@ -733,7 +733,7 @@ static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd)
|
||||||
{
|
{
|
||||||
PCIDevice *pci_dev = PCI_DEVICE(s);
|
PCIDevice *pci_dev = PCI_DEVICE(s);
|
||||||
PCIDeviceClass *pci_class = PCI_DEVICE_GET_CLASS(pci_dev);
|
PCIDeviceClass *pci_class = PCI_DEVICE_GET_CLASS(pci_dev);
|
||||||
MegasasBaseClass *base_class = MEGASAS_DEVICE_GET_CLASS(s);
|
MegasasBaseClass *base_class = MEGASAS_GET_CLASS(s);
|
||||||
struct mfi_ctrl_info info;
|
struct mfi_ctrl_info info;
|
||||||
size_t dcmd_size = sizeof(info);
|
size_t dcmd_size = sizeof(info);
|
||||||
BusChild *kid;
|
BusChild *kid;
|
||||||
|
@ -1999,7 +1999,7 @@ static uint64_t megasas_mmio_read(void *opaque, hwaddr addr,
|
||||||
{
|
{
|
||||||
MegasasState *s = opaque;
|
MegasasState *s = opaque;
|
||||||
PCIDevice *pci_dev = PCI_DEVICE(s);
|
PCIDevice *pci_dev = PCI_DEVICE(s);
|
||||||
MegasasBaseClass *base_class = MEGASAS_DEVICE_GET_CLASS(s);
|
MegasasBaseClass *base_class = MEGASAS_GET_CLASS(s);
|
||||||
uint32_t retval = 0;
|
uint32_t retval = 0;
|
||||||
|
|
||||||
switch (addr) {
|
switch (addr) {
|
||||||
|
@ -2322,7 +2322,7 @@ static const struct SCSIBusInfo megasas_scsi_info = {
|
||||||
static void megasas_scsi_realize(PCIDevice *dev, Error **errp)
|
static void megasas_scsi_realize(PCIDevice *dev, Error **errp)
|
||||||
{
|
{
|
||||||
MegasasState *s = MEGASAS(dev);
|
MegasasState *s = MEGASAS(dev);
|
||||||
MegasasBaseClass *b = MEGASAS_DEVICE_GET_CLASS(s);
|
MegasasBaseClass *b = MEGASAS_GET_CLASS(s);
|
||||||
uint8_t *pci_conf;
|
uint8_t *pci_conf;
|
||||||
int i, bar_type;
|
int i, bar_type;
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
|
@ -2506,7 +2506,7 @@ static void megasas_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||||
PCIDeviceClass *pc = PCI_DEVICE_CLASS(oc);
|
PCIDeviceClass *pc = PCI_DEVICE_CLASS(oc);
|
||||||
MegasasBaseClass *e = MEGASAS_DEVICE_CLASS(oc);
|
MegasasBaseClass *e = MEGASAS_CLASS(oc);
|
||||||
const MegasasInfo *info = data;
|
const MegasasInfo *info = data;
|
||||||
|
|
||||||
pc->realize = megasas_scsi_realize;
|
pc->realize = megasas_scsi_realize;
|
||||||
|
|
Loading…
Reference in a new issue