From 8063396bf3459a810d24e3efd6110b8480f0de5b Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 16 Sep 2020 14:25:19 -0400 Subject: Use OBJECT_DECLARE_SIMPLE_TYPE when possible This converts existing DECLARE_INSTANCE_CHECKER usage to OBJECT_DECLARE_SIMPLE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost Acked-by: Paul Durrant Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/i2c/bitbang_i2c.c | 4 +--- hw/i2c/exynos4210_i2c.c | 4 +--- hw/i2c/mpc_i2c.c | 4 +--- hw/i2c/smbus_eeprom.c | 4 +--- hw/i2c/smbus_ich9.c | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) (limited to 'hw/i2c') diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index c1b9f29..e9a0612 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -163,9 +163,7 @@ void bitbang_i2c_init(bitbang_i2c_interface *s, I2CBus *bus) /* GPIO interface. */ #define TYPE_GPIO_I2C "gpio_i2c" -typedef struct GPIOI2CState GPIOI2CState; -DECLARE_INSTANCE_CHECKER(GPIOI2CState, GPIO_I2C, - TYPE_GPIO_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(GPIOI2CState, GPIO_I2C) struct GPIOI2CState { SysBusDevice parent_obj; diff --git a/hw/i2c/exynos4210_i2c.c b/hw/i2c/exynos4210_i2c.c index ff82226..b65a7d0 100644 --- a/hw/i2c/exynos4210_i2c.c +++ b/hw/i2c/exynos4210_i2c.c @@ -34,9 +34,7 @@ #endif #define TYPE_EXYNOS4_I2C "exynos4210.i2c" -typedef struct Exynos4210I2CState Exynos4210I2CState; -DECLARE_INSTANCE_CHECKER(Exynos4210I2CState, EXYNOS4_I2C, - TYPE_EXYNOS4_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210I2CState, EXYNOS4_I2C) /* Exynos4210 I2C memory map */ #define EXYNOS4_I2C_MEM_SIZE 0x14 diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 156a25a..720d233 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -37,9 +37,7 @@ #endif #define TYPE_MPC_I2C "mpc-i2c" -typedef struct MPCI2CState MPCI2CState; -DECLARE_INSTANCE_CHECKER(MPCI2CState, MPC_I2C, - TYPE_MPC_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(MPCI2CState, MPC_I2C) #define MPC_I2C_ADR 0x00 #define MPC_I2C_FDR 0x04 diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index c677784..4d2bf99 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -37,9 +37,7 @@ #define TYPE_SMBUS_EEPROM "smbus-eeprom" -typedef struct SMBusEEPROMDevice SMBusEEPROMDevice; -DECLARE_INSTANCE_CHECKER(SMBusEEPROMDevice, SMBUS_EEPROM, - TYPE_SMBUS_EEPROM) +OBJECT_DECLARE_SIMPLE_TYPE(SMBusEEPROMDevice, SMBUS_EEPROM) #define SMBUS_EEPROM_SIZE 256 diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 2d45785..44dd565 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -30,9 +30,7 @@ #include "hw/i386/ich9.h" #include "qom/object.h" -typedef struct ICH9SMBState ICH9SMBState; -DECLARE_INSTANCE_CHECKER(ICH9SMBState, ICH9_SMB_DEVICE, - TYPE_ICH9_SMB_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ICH9SMBState, ICH9_SMB_DEVICE) struct ICH9SMBState { PCIDevice dev; -- cgit v1.1