summaryrefslogtreecommitdiffstats
path: root/hw/rtc
diff options
context:
space:
mode:
authorEduardo Habkost2020-08-31 23:07:33 +0200
committerEduardo Habkost2020-09-09 15:27:09 +0200
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /hw/rtc
parentMove QOM typedefs and add missing includes (diff)
downloadqemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.gz
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.xz
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.zip
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 'hw/rtc')
-rw-r--r--hw/rtc/ds1338.c3
-rw-r--r--hw/rtc/exynos4210_rtc.c4
-rw-r--r--hw/rtc/m41t80.c3
-rw-r--r--hw/rtc/m48t59-isa.c8
-rw-r--r--hw/rtc/m48t59.c8
-rw-r--r--hw/rtc/sun4v-rtc.c3
-rw-r--r--hw/rtc/twl92230.c3
7 files changed, 14 insertions, 18 deletions
diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c
index 8b2b7973d8..10fac3d9c9 100644
--- a/hw/rtc/ds1338.c
+++ b/hw/rtc/ds1338.c
@@ -31,7 +31,8 @@
#define TYPE_DS1338 "ds1338"
typedef struct DS1338State DS1338State;
-#define DS1338(obj) OBJECT_CHECK(DS1338State, (obj), TYPE_DS1338)
+DECLARE_INSTANCE_CHECKER(DS1338State, DS1338,
+ TYPE_DS1338)
struct DS1338State {
I2CSlave parent_obj;
diff --git a/hw/rtc/exynos4210_rtc.c b/hw/rtc/exynos4210_rtc.c
index a95f07ef0b..f8a4fe8a47 100644
--- a/hw/rtc/exynos4210_rtc.c
+++ b/hw/rtc/exynos4210_rtc.c
@@ -86,8 +86,8 @@
#define TYPE_EXYNOS4210_RTC "exynos4210.rtc"
typedef struct Exynos4210RTCState Exynos4210RTCState;
-#define EXYNOS4210_RTC(obj) \
- OBJECT_CHECK(Exynos4210RTCState, (obj), TYPE_EXYNOS4210_RTC)
+DECLARE_INSTANCE_CHECKER(Exynos4210RTCState, EXYNOS4210_RTC,
+ TYPE_EXYNOS4210_RTC)
struct Exynos4210RTCState {
SysBusDevice parent_obj;
diff --git a/hw/rtc/m41t80.c b/hw/rtc/m41t80.c
index 31445e9691..0b7048c3f4 100644
--- a/hw/rtc/m41t80.c
+++ b/hw/rtc/m41t80.c
@@ -18,7 +18,8 @@
#define TYPE_M41T80 "m41t80"
typedef struct M41t80State M41t80State;
-#define M41T80(obj) OBJECT_CHECK(M41t80State, (obj), TYPE_M41T80)
+DECLARE_INSTANCE_CHECKER(M41t80State, M41T80,
+ TYPE_M41T80)
struct M41t80State {
I2CSlave parent_obj;
diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c
index dc608e0b02..cae315e488 100644
--- a/hw/rtc/m48t59-isa.c
+++ b/hw/rtc/m48t59-isa.c
@@ -35,12 +35,8 @@
#define TYPE_M48TXX_ISA "isa-m48txx"
typedef struct M48txxISADeviceClass M48txxISADeviceClass;
typedef struct M48txxISAState M48txxISAState;
-#define M48TXX_ISA_GET_CLASS(obj) \
- OBJECT_GET_CLASS(M48txxISADeviceClass, (obj), TYPE_M48TXX_ISA)
-#define M48TXX_ISA_CLASS(klass) \
- OBJECT_CLASS_CHECK(M48txxISADeviceClass, (klass), TYPE_M48TXX_ISA)
-#define M48TXX_ISA(obj) \
- OBJECT_CHECK(M48txxISAState, (obj), TYPE_M48TXX_ISA)
+DECLARE_OBJ_CHECKERS(M48txxISAState, M48txxISADeviceClass,
+ M48TXX_ISA, TYPE_M48TXX_ISA)
struct M48txxISAState {
ISADevice parent_obj;
diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c
index 9f5a96af82..6525206976 100644
--- a/hw/rtc/m48t59.c
+++ b/hw/rtc/m48t59.c
@@ -45,12 +45,8 @@
#define TYPE_M48TXX_SYS_BUS "sysbus-m48txx"
typedef struct M48txxSysBusDeviceClass M48txxSysBusDeviceClass;
typedef struct M48txxSysBusState M48txxSysBusState;
-#define M48TXX_SYS_BUS_GET_CLASS(obj) \
- OBJECT_GET_CLASS(M48txxSysBusDeviceClass, (obj), TYPE_M48TXX_SYS_BUS)
-#define M48TXX_SYS_BUS_CLASS(klass) \
- OBJECT_CLASS_CHECK(M48txxSysBusDeviceClass, (klass), TYPE_M48TXX_SYS_BUS)
-#define M48TXX_SYS_BUS(obj) \
- OBJECT_CHECK(M48txxSysBusState, (obj), TYPE_M48TXX_SYS_BUS)
+DECLARE_OBJ_CHECKERS(M48txxSysBusState, M48txxSysBusDeviceClass,
+ M48TXX_SYS_BUS, TYPE_M48TXX_SYS_BUS)
/*
* Chipset docs:
diff --git a/hw/rtc/sun4v-rtc.c b/hw/rtc/sun4v-rtc.c
index b5ebefd1b2..18979d25d0 100644
--- a/hw/rtc/sun4v-rtc.c
+++ b/hw/rtc/sun4v-rtc.c
@@ -21,7 +21,8 @@
#define TYPE_SUN4V_RTC "sun4v_rtc"
typedef struct Sun4vRtc Sun4vRtc;
-#define SUN4V_RTC(obj) OBJECT_CHECK(Sun4vRtc, (obj), TYPE_SUN4V_RTC)
+DECLARE_INSTANCE_CHECKER(Sun4vRtc, SUN4V_RTC,
+ TYPE_SUN4V_RTC)
struct Sun4vRtc {
SysBusDevice parent_obj;
diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c
index d46f21430c..4f83eff5c3 100644
--- a/hw/rtc/twl92230.c
+++ b/hw/rtc/twl92230.c
@@ -35,7 +35,8 @@
#define TYPE_TWL92230 "twl92230"
typedef struct MenelausState MenelausState;
-#define TWL92230(obj) OBJECT_CHECK(MenelausState, (obj), TYPE_TWL92230)
+DECLARE_INSTANCE_CHECKER(MenelausState, TWL92230,
+ TYPE_TWL92230)
struct MenelausState {
I2CSlave parent_obj;