aboutsummaryrefslogtreecommitdiff
path: root/include/hw/ide
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-31 17:07:33 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:27:09 -0400
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /include/hw/ide
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/ide')
-rw-r--r--include/hw/ide/ahci.h11
-rw-r--r--include/hw/ide/internal.h11
-rw-r--r--include/hw/ide/pci.h3
3 files changed, 12 insertions, 13 deletions
diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h
index 110269f152..4cf6813d80 100644
--- a/include/hw/ide/ahci.h
+++ b/include/hw/ide/ahci.h
@@ -54,15 +54,16 @@ typedef struct AHCIState {
typedef struct AHCIPCIState AHCIPCIState;
#define TYPE_ICH9_AHCI "ich9-ahci"
-#define ICH_AHCI(obj) \
- OBJECT_CHECK(AHCIPCIState, (obj), TYPE_ICH9_AHCI)
+DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH_AHCI,
+ TYPE_ICH9_AHCI)
int32_t ahci_get_num_ports(PCIDevice *dev);
void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd);
#define TYPE_SYSBUS_AHCI "sysbus-ahci"
typedef struct SysbusAHCIState SysbusAHCIState;
-#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI)
+DECLARE_INSTANCE_CHECKER(SysbusAHCIState, SYSBUS_AHCI,
+ TYPE_SYSBUS_AHCI)
struct SysbusAHCIState {
/*< private >*/
@@ -75,8 +76,8 @@ struct SysbusAHCIState {
#define TYPE_ALLWINNER_AHCI "allwinner-ahci"
typedef struct AllwinnerAHCIState AllwinnerAHCIState;
-#define ALLWINNER_AHCI(obj) \
- OBJECT_CHECK(AllwinnerAHCIState, (obj), TYPE_ALLWINNER_AHCI)
+DECLARE_INSTANCE_CHECKER(AllwinnerAHCIState, ALLWINNER_AHCI,
+ TYPE_ALLWINNER_AHCI)
#define ALLWINNER_AHCI_MMIO_OFF 0x80
#define ALLWINNER_AHCI_MMIO_SIZE 0x80
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 74ea1e324c..eb9eb4e0ae 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -26,7 +26,8 @@ typedef struct IDEDMA IDEDMA;
typedef struct IDEDMAOps IDEDMAOps;
#define TYPE_IDE_BUS "IDE"
-#define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
+DECLARE_INSTANCE_CHECKER(IDEBus, IDE_BUS,
+ TYPE_IDE_BUS)
#define MAX_IDE_DEVS 2
@@ -488,12 +489,8 @@ struct IDEBus {
#define TYPE_IDE_DEVICE "ide-device"
typedef struct IDEDeviceClass IDEDeviceClass;
-#define IDE_DEVICE(obj) \
- OBJECT_CHECK(IDEDevice, (obj), TYPE_IDE_DEVICE)
-#define IDE_DEVICE_CLASS(klass) \
- OBJECT_CLASS_CHECK(IDEDeviceClass, (klass), TYPE_IDE_DEVICE)
-#define IDE_DEVICE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(IDEDeviceClass, (obj), TYPE_IDE_DEVICE)
+DECLARE_OBJ_CHECKERS(IDEDevice, IDEDeviceClass,
+ IDE_DEVICE, TYPE_IDE_DEVICE)
struct IDEDeviceClass {
DeviceClass parent_class;
diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h
index 7ed1fa101d..b8d7270ec8 100644
--- a/include/hw/ide/pci.h
+++ b/include/hw/ide/pci.h
@@ -41,7 +41,8 @@ typedef struct BMDMAState {
#define TYPE_PCI_IDE "pci-ide"
typedef struct PCIIDEState PCIIDEState;
-#define PCI_IDE(obj) OBJECT_CHECK(PCIIDEState, (obj), TYPE_PCI_IDE)
+DECLARE_INSTANCE_CHECKER(PCIIDEState, PCI_IDE,
+ TYPE_PCI_IDE)
struct PCIIDEState {
/*< private >*/