aboutsummaryrefslogtreecommitdiff
path: root/include/hw/watchdog
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/watchdog
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/watchdog')
-rw-r--r--include/hw/watchdog/cmsdk-apb-watchdog.h4
-rw-r--r--include/hw/watchdog/wdt_aspeed.h8
-rw-r--r--include/hw/watchdog/wdt_diag288.h8
-rw-r--r--include/hw/watchdog/wdt_imx2.h3
4 files changed, 8 insertions, 15 deletions
diff --git a/include/hw/watchdog/cmsdk-apb-watchdog.h b/include/hw/watchdog/cmsdk-apb-watchdog.h
index be2983eefa..63f4becf86 100644
--- a/include/hw/watchdog/cmsdk-apb-watchdog.h
+++ b/include/hw/watchdog/cmsdk-apb-watchdog.h
@@ -37,8 +37,8 @@
#define TYPE_CMSDK_APB_WATCHDOG "cmsdk-apb-watchdog"
typedef struct CMSDKAPBWatchdog CMSDKAPBWatchdog;
-#define CMSDK_APB_WATCHDOG(obj) OBJECT_CHECK(CMSDKAPBWatchdog, (obj), \
- TYPE_CMSDK_APB_WATCHDOG)
+DECLARE_INSTANCE_CHECKER(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG,
+ TYPE_CMSDK_APB_WATCHDOG)
/*
* This shares the same struct (and cast macro) as the base
diff --git a/include/hw/watchdog/wdt_aspeed.h b/include/hw/watchdog/wdt_aspeed.h
index ba9a0a1fd8..2ca1eb5432 100644
--- a/include/hw/watchdog/wdt_aspeed.h
+++ b/include/hw/watchdog/wdt_aspeed.h
@@ -17,8 +17,8 @@
#define TYPE_ASPEED_WDT "aspeed.wdt"
typedef struct AspeedWDTClass AspeedWDTClass;
typedef struct AspeedWDTState AspeedWDTState;
-#define ASPEED_WDT(obj) \
- OBJECT_CHECK(AspeedWDTState, (obj), TYPE_ASPEED_WDT)
+DECLARE_OBJ_CHECKERS(AspeedWDTState, AspeedWDTClass,
+ ASPEED_WDT, TYPE_ASPEED_WDT)
#define TYPE_ASPEED_2400_WDT TYPE_ASPEED_WDT "-ast2400"
#define TYPE_ASPEED_2500_WDT TYPE_ASPEED_WDT "-ast2500"
#define TYPE_ASPEED_2600_WDT TYPE_ASPEED_WDT "-ast2600"
@@ -38,10 +38,6 @@ struct AspeedWDTState {
uint32_t pclk_freq;
};
-#define ASPEED_WDT_CLASS(klass) \
- OBJECT_CLASS_CHECK(AspeedWDTClass, (klass), TYPE_ASPEED_WDT)
-#define ASPEED_WDT_GET_CLASS(obj) \
- OBJECT_GET_CLASS(AspeedWDTClass, (obj), TYPE_ASPEED_WDT)
struct AspeedWDTClass {
SysBusDeviceClass parent_class;
diff --git a/include/hw/watchdog/wdt_diag288.h b/include/hw/watchdog/wdt_diag288.h
index e611163821..f72c1d3318 100644
--- a/include/hw/watchdog/wdt_diag288.h
+++ b/include/hw/watchdog/wdt_diag288.h
@@ -7,12 +7,8 @@
#define TYPE_WDT_DIAG288 "diag288"
typedef struct DIAG288Class DIAG288Class;
typedef struct DIAG288State DIAG288State;
-#define DIAG288(obj) \
- OBJECT_CHECK(DIAG288State, (obj), TYPE_WDT_DIAG288)
-#define DIAG288_CLASS(klass) \
- OBJECT_CLASS_CHECK(DIAG288Class, (klass), TYPE_WDT_DIAG288)
-#define DIAG288_GET_CLASS(obj) \
- OBJECT_GET_CLASS(DIAG288Class, (obj), TYPE_WDT_DIAG288)
+DECLARE_OBJ_CHECKERS(DIAG288State, DIAG288Class,
+ DIAG288, TYPE_WDT_DIAG288)
#define WDT_DIAG288_INIT 0
#define WDT_DIAG288_CHANGE 1
diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h
index 8757418b46..7665d93640 100644
--- a/include/hw/watchdog/wdt_imx2.h
+++ b/include/hw/watchdog/wdt_imx2.h
@@ -20,7 +20,8 @@
#define TYPE_IMX2_WDT "imx2.wdt"
typedef struct IMX2WdtState IMX2WdtState;
-#define IMX2_WDT(obj) OBJECT_CHECK(IMX2WdtState, (obj), TYPE_IMX2_WDT)
+DECLARE_INSTANCE_CHECKER(IMX2WdtState, IMX2_WDT,
+ TYPE_IMX2_WDT)
enum IMX2WdtRegisters {
IMX2_WDT_WCR = 0x0000, /* Control Register */