aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-16 14:25:18 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-18 14:12:32 -0400
commita489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (patch)
tree1b0c2f48420f830de630eae114d39dc88c3496f4 /hw
parent30b5707c269cac1ad80b72f777e52c8e08b2ff19 (diff)
Use OBJECT_DECLARE_TYPE when possible
This converts existing DECLARE_OBJ_CHECKERS usage to OBJECT_DECLARE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Acked-by: Paul Durrant <paul@xen.org> Message-Id: <20200916182519.415636-5-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/arm/mps2-tz.c5
-rw-r--r--hw/arm/mps2.c5
-rw-r--r--hw/arm/musca.c5
-rw-r--r--hw/arm/spitz.c5
-rw-r--r--hw/arm/vexpress.c5
-rw-r--r--hw/block/m25p80.c5
-rw-r--r--hw/input/adb-kbd.c5
-rw-r--r--hw/input/adb-mouse.c5
-rw-r--r--hw/misc/tmp421.c5
-rw-r--r--hw/ppc/e500.h5
-rw-r--r--hw/s390x/ccw-device.h4
-rw-r--r--hw/s390x/virtio-ccw.h5
-rw-r--r--hw/scsi/scsi-disk.c5
-rw-r--r--hw/scsi/vmw_pvscsi.c5
-rw-r--r--hw/usb/ccid.h5
-rw-r--r--hw/usb/hcd-dwc2.h3
-rw-r--r--hw/usb/hcd-ehci.h5
-rw-r--r--hw/virtio/virtio-pci.h5
18 files changed, 18 insertions, 69 deletions
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index dbf7d63dc8..3707876d6d 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -77,7 +77,6 @@ struct MPS2TZMachineClass {
uint32_t scc_id;
const char *armsse_type;
};
-typedef struct MPS2TZMachineClass MPS2TZMachineClass;
struct MPS2TZMachineState {
MachineState parent;
@@ -102,14 +101,12 @@ struct MPS2TZMachineState {
DeviceState *lan9118;
SplitIRQ cpu_irq_splitter[MPS2TZ_NUMIRQ];
};
-typedef struct MPS2TZMachineState MPS2TZMachineState;
#define TYPE_MPS2TZ_MACHINE "mps2tz"
#define TYPE_MPS2TZ_AN505_MACHINE MACHINE_TYPE_NAME("mps2-an505")
#define TYPE_MPS2TZ_AN521_MACHINE MACHINE_TYPE_NAME("mps2-an521")
-DECLARE_OBJ_CHECKERS(MPS2TZMachineState, MPS2TZMachineClass,
- MPS2TZ_MACHINE, TYPE_MPS2TZ_MACHINE)
+OBJECT_DECLARE_TYPE(MPS2TZMachineState, MPS2TZMachineClass, MPS2TZ_MACHINE)
/* Main SYSCLK frequency in Hz */
#define SYSCLK_FRQ 20000000
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index 5d47160850..9a8b23c64c 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -63,7 +63,6 @@ struct MPS2MachineClass {
hwaddr ethernet_base;
hwaddr psram_base;
};
-typedef struct MPS2MachineClass MPS2MachineClass;
struct MPS2MachineState {
MachineState parent;
@@ -85,7 +84,6 @@ struct MPS2MachineState {
CMSDKAPBDualTimer dualtimer;
CMSDKAPBWatchdog watchdog;
};
-typedef struct MPS2MachineState MPS2MachineState;
#define TYPE_MPS2_MACHINE "mps2"
#define TYPE_MPS2_AN385_MACHINE MACHINE_TYPE_NAME("mps2-an385")
@@ -93,8 +91,7 @@ typedef struct MPS2MachineState MPS2MachineState;
#define TYPE_MPS2_AN500_MACHINE MACHINE_TYPE_NAME("mps2-an500")
#define TYPE_MPS2_AN511_MACHINE MACHINE_TYPE_NAME("mps2-an511")
-DECLARE_OBJ_CHECKERS(MPS2MachineState, MPS2MachineClass,
- MPS2_MACHINE, TYPE_MPS2_MACHINE)
+OBJECT_DECLARE_TYPE(MPS2MachineState, MPS2MachineClass, MPS2_MACHINE)
/* Main SYSCLK frequency in Hz */
#define SYSCLK_FRQ 25000000
diff --git a/hw/arm/musca.c b/hw/arm/musca.c
index 16015255c8..b50157f63a 100644
--- a/hw/arm/musca.c
+++ b/hw/arm/musca.c
@@ -55,7 +55,6 @@ struct MuscaMachineClass {
const MPCInfo *mpc_info;
int num_mpcs;
};
-typedef struct MuscaMachineClass MuscaMachineClass;
struct MuscaMachineState {
MachineState parent;
@@ -84,14 +83,12 @@ struct MuscaMachineState {
UnimplementedDeviceState gpio;
UnimplementedDeviceState cryptoisland;
};
-typedef struct MuscaMachineState MuscaMachineState;
#define TYPE_MUSCA_MACHINE "musca"
#define TYPE_MUSCA_A_MACHINE MACHINE_TYPE_NAME("musca-a")
#define TYPE_MUSCA_B1_MACHINE MACHINE_TYPE_NAME("musca-b1")
-DECLARE_OBJ_CHECKERS(MuscaMachineState, MuscaMachineClass,
- MUSCA_MACHINE, TYPE_MUSCA_MACHINE)
+OBJECT_DECLARE_TYPE(MuscaMachineState, MuscaMachineClass, MUSCA_MACHINE)
/*
* Main SYSCLK frequency in Hz
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index a7ad667f06..b5b867e6ed 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -43,7 +43,6 @@ struct SpitzMachineClass {
enum spitz_model_e model;
int arm_id;
};
-typedef struct SpitzMachineClass SpitzMachineClass;
struct SpitzMachineState {
MachineState parent;
@@ -56,11 +55,9 @@ struct SpitzMachineState {
DeviceState *scp1;
DeviceState *misc_gpio;
};
-typedef struct SpitzMachineState SpitzMachineState;
#define TYPE_SPITZ_MACHINE "spitz-common"
-DECLARE_OBJ_CHECKERS(SpitzMachineState, SpitzMachineClass,
- SPITZ_MACHINE, TYPE_SPITZ_MACHINE)
+OBJECT_DECLARE_TYPE(SpitzMachineState, SpitzMachineClass, SPITZ_MACHINE)
#define zaurus_printf(format, ...) \
fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__)
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 01bb4bba1e..94ff094ab3 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -171,20 +171,17 @@ struct VexpressMachineClass {
MachineClass parent;
VEDBoardInfo *daughterboard;
};
-typedef struct VexpressMachineClass VexpressMachineClass;
struct VexpressMachineState {
MachineState parent;
bool secure;
bool virt;
};
-typedef struct VexpressMachineState VexpressMachineState;
#define TYPE_VEXPRESS_MACHINE "vexpress"
#define TYPE_VEXPRESS_A9_MACHINE MACHINE_TYPE_NAME("vexpress-a9")
#define TYPE_VEXPRESS_A15_MACHINE MACHINE_TYPE_NAME("vexpress-a15")
-DECLARE_OBJ_CHECKERS(VexpressMachineState, VexpressMachineClass,
- VEXPRESS_MACHINE, TYPE_VEXPRESS_MACHINE)
+OBJECT_DECLARE_TYPE(VexpressMachineState, VexpressMachineClass, VEXPRESS_MACHINE)
typedef void DBoardInitFn(const VexpressMachineState *machine,
ram_addr_t ram_size,
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 8dae779c76..483925f57a 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -456,17 +456,14 @@ struct Flash {
const FlashPartInfo *pi;
};
-typedef struct Flash Flash;
struct M25P80Class {
SSISlaveClass parent_class;
FlashPartInfo *pi;
};
-typedef struct M25P80Class M25P80Class;
#define TYPE_M25P80 "m25p80-generic"
-DECLARE_OBJ_CHECKERS(Flash, M25P80Class,
- M25P80, TYPE_M25P80)
+OBJECT_DECLARE_TYPE(Flash, M25P80Class, M25P80)
static inline Manufacturer get_man(Flash *s)
{
diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c
index fe0c363d64..a9088c910c 100644
--- a/hw/input/adb-kbd.c
+++ b/hw/input/adb-kbd.c
@@ -32,10 +32,7 @@
#include "trace.h"
#include "qom/object.h"
-typedef struct ADBKeyboardClass ADBKeyboardClass;
-typedef struct KBDState KBDState;
-DECLARE_OBJ_CHECKERS(KBDState, ADBKeyboardClass,
- ADB_KEYBOARD, TYPE_ADB_KEYBOARD)
+OBJECT_DECLARE_TYPE(KBDState, ADBKeyboardClass, ADB_KEYBOARD)
struct KBDState {
/*< private >*/
diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c
index f5750909b4..e6b341f028 100644
--- a/hw/input/adb-mouse.c
+++ b/hw/input/adb-mouse.c
@@ -31,10 +31,7 @@
#include "trace.h"
#include "qom/object.h"
-typedef struct ADBMouseClass ADBMouseClass;
-typedef struct MouseState MouseState;
-DECLARE_OBJ_CHECKERS(MouseState, ADBMouseClass,
- ADB_MOUSE, TYPE_ADB_MOUSE)
+OBJECT_DECLARE_TYPE(MouseState, ADBMouseClass, ADB_MOUSE)
struct MouseState {
/*< public >*/
diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c
index 212d6e0e83..ef3c682e32 100644
--- a/hw/misc/tmp421.c
+++ b/hw/misc/tmp421.c
@@ -65,17 +65,14 @@ struct TMP421State {
uint8_t pointer;
};
-typedef struct TMP421State TMP421State;
struct TMP421Class {
I2CSlaveClass parent_class;
DeviceInfo *dev;
};
-typedef struct TMP421Class TMP421Class;
#define TYPE_TMP421 "tmp421-generic"
-DECLARE_OBJ_CHECKERS(TMP421State, TMP421Class,
- TMP421, TYPE_TMP421)
+OBJECT_DECLARE_TYPE(TMP421State, TMP421Class, TMP421)
/* the TMP421 registers */
diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h
index 63870751ff..1e5853b032 100644
--- a/hw/ppc/e500.h
+++ b/hw/ppc/e500.h
@@ -14,7 +14,6 @@ struct PPCE500MachineState {
*/
PlatformBusDevice *pbus_dev;
};
-typedef struct PPCE500MachineState PPCE500MachineState;
struct PPCE500MachineClass {
/*< private >*/
@@ -39,14 +38,12 @@ struct PPCE500MachineClass {
hwaddr pci_mmio_bus_base;
hwaddr spin_base;
};
-typedef struct PPCE500MachineClass PPCE500MachineClass;
void ppce500_init(MachineState *machine);
hwaddr booke206_page_size_to_tlb(uint64_t size);
#define TYPE_PPCE500_MACHINE "ppce500-base-machine"
-DECLARE_OBJ_CHECKERS(PPCE500MachineState, PPCE500MachineClass,
- PPCE500_MACHINE, TYPE_PPCE500_MACHINE)
+OBJECT_DECLARE_TYPE(PPCE500MachineState, PPCE500MachineClass, PPCE500_MACHINE)
#endif
diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h
index cf7d492084..832c78cd42 100644
--- a/hw/s390x/ccw-device.h
+++ b/hw/s390x/ccw-device.h
@@ -38,7 +38,6 @@ struct CCWDeviceClass {
void (*realize)(CcwDevice *, Error **);
void (*refill_ids)(CcwDevice *);
};
-typedef struct CCWDeviceClass CCWDeviceClass;
static inline CcwDevice *to_ccw_dev_fast(DeviceState *d)
{
@@ -47,7 +46,6 @@ static inline CcwDevice *to_ccw_dev_fast(DeviceState *d)
#define TYPE_CCW_DEVICE "ccw-device"
-DECLARE_OBJ_CHECKERS(CcwDevice, CCWDeviceClass,
- CCW_DEVICE, TYPE_CCW_DEVICE)
+OBJECT_DECLARE_TYPE(CcwDevice, CCWDeviceClass, CCW_DEVICE)
#endif
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index cea259685d..21790608b4 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -54,10 +54,7 @@
#define CCW_CMD_SET_VIRTIO_REV 0x83
#define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device"
-typedef struct VirtIOCCWDeviceClass VirtIOCCWDeviceClass;
-typedef struct VirtioCcwDevice VirtioCcwDevice;
-DECLARE_OBJ_CHECKERS(VirtioCcwDevice, VirtIOCCWDeviceClass,
- VIRTIO_CCW_DEVICE, TYPE_VIRTIO_CCW_DEVICE)
+OBJECT_DECLARE_TYPE(VirtioCcwDevice, VirtIOCCWDeviceClass, VIRTIO_CCW_DEVICE)
typedef struct VirtioBusState VirtioCcwBusState;
typedef struct VirtioBusClass VirtioCcwBusClass;
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 1f0388a755..e859534eaf 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -55,10 +55,7 @@
#define TYPE_SCSI_DISK_BASE "scsi-disk-base"
-typedef struct SCSIDiskClass SCSIDiskClass;
-typedef struct SCSIDiskState SCSIDiskState;
-DECLARE_OBJ_CHECKERS(SCSIDiskState, SCSIDiskClass,
- SCSI_DISK_BASE, TYPE_SCSI_DISK_BASE)
+OBJECT_DECLARE_TYPE(SCSIDiskState, SCSIDiskClass, SCSI_DISK_BASE)
struct SCSIDiskClass {
SCSIDeviceClass parent_class;
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 40095bed09..a63d25de48 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -61,12 +61,9 @@ struct PVSCSIClass {
PCIDeviceClass parent_class;
DeviceRealize parent_dc_realize;
};
-typedef struct PVSCSIClass PVSCSIClass;
#define TYPE_PVSCSI "pvscsi"
-typedef struct PVSCSIState PVSCSIState;
-DECLARE_OBJ_CHECKERS(PVSCSIState, PVSCSIClass,
- PVSCSI, TYPE_PVSCSI)
+OBJECT_DECLARE_TYPE(PVSCSIState, PVSCSIClass, PVSCSI)
/* Compatibility flags for migration */
diff --git a/hw/usb/ccid.h b/hw/usb/ccid.h
index ef2bb3462d..6b82a55bd4 100644
--- a/hw/usb/ccid.h
+++ b/hw/usb/ccid.h
@@ -13,13 +13,10 @@
#include "hw/qdev-core.h"
#include "qom/object.h"
-typedef struct CCIDCardState CCIDCardState;
typedef struct CCIDCardInfo CCIDCardInfo;
#define TYPE_CCID_CARD "ccid-card"
-typedef struct CCIDCardClass CCIDCardClass;
-DECLARE_OBJ_CHECKERS(CCIDCardState, CCIDCardClass,
- CCID_CARD, TYPE_CCID_CARD)
+OBJECT_DECLARE_TYPE(CCIDCardState, CCIDCardClass, CCID_CARD)
/*
* callbacks to be used by the CCID device (hw/usb-ccid.c) to call
diff --git a/hw/usb/hcd-dwc2.h b/hw/usb/hcd-dwc2.h
index 919e3e43b1..6998b04706 100644
--- a/hw/usb/hcd-dwc2.h
+++ b/hw/usb/hcd-dwc2.h
@@ -181,7 +181,6 @@ struct DWC2Class {
};
#define TYPE_DWC2_USB "dwc2-usb"
-DECLARE_OBJ_CHECKERS(DWC2State, DWC2Class,
- DWC2_USB, TYPE_DWC2_USB)
+OBJECT_DECLARE_TYPE(DWC2State, DWC2Class, DWC2_USB)
#endif
diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h
index 1301ce0be7..199913bca5 100644
--- a/hw/usb/hcd-ehci.h
+++ b/hw/usb/hcd-ehci.h
@@ -350,10 +350,7 @@ struct EHCIPCIState {
#define TYPE_PPC4xx_EHCI "ppc4xx-ehci-usb"
#define TYPE_FUSBH200_EHCI "fusbh200-ehci-usb"
-typedef struct EHCISysBusState EHCISysBusState;
-typedef struct SysBusEHCIClass SysBusEHCIClass;
-DECLARE_OBJ_CHECKERS(EHCISysBusState, SysBusEHCIClass,
- SYS_BUS_EHCI, TYPE_SYS_BUS_EHCI)
+OBJECT_DECLARE_TYPE(EHCISysBusState, SysBusEHCIClass, SYS_BUS_EHCI)
struct EHCISysBusState {
/*< private >*/
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index 47b6bb4e26..06e2af12de 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -19,7 +19,6 @@
#include "hw/virtio/virtio-bus.h"
#include "qom/object.h"
-typedef struct VirtIOPCIProxy VirtIOPCIProxy;
/* virtio-pci-bus */
@@ -91,9 +90,7 @@ typedef struct {
* virtio-pci: This is the PCIDevice which has a virtio-pci-bus.
*/
#define TYPE_VIRTIO_PCI "virtio-pci"
-typedef struct VirtioPCIClass VirtioPCIClass;
-DECLARE_OBJ_CHECKERS(VirtIOPCIProxy, VirtioPCIClass,
- VIRTIO_PCI, TYPE_VIRTIO_PCI)
+OBJECT_DECLARE_TYPE(VirtIOPCIProxy, VirtioPCIClass, VIRTIO_PCI)
struct VirtioPCIClass {
PCIDeviceClass parent_class;