aboutsummaryrefslogtreecommitdiff
path: root/include/hw/char
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-16 14:25:19 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-18 14:12:32 -0400
commit8063396bf3459a810d24e3efd6110b8480f0de5b (patch)
tree40f85f15d7016e3ee66916a59be53d2b2c71510a /include/hw/char
parenta489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (diff)
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 <ehabkost@redhat.com> Acked-by: Paul Durrant <paul@xen.org> Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/char')
-rw-r--r--include/hw/char/avr_usart.h4
-rw-r--r--include/hw/char/bcm2835_aux.h4
-rw-r--r--include/hw/char/cadence_uart.h4
-rw-r--r--include/hw/char/cmsdk-apb-uart.h4
-rw-r--r--include/hw/char/digic-uart.h4
-rw-r--r--include/hw/char/escc.h4
-rw-r--r--include/hw/char/ibex_uart.h4
-rw-r--r--include/hw/char/imx_serial.h4
-rw-r--r--include/hw/char/nrf51_uart.h4
-rw-r--r--include/hw/char/pl011.h4
-rw-r--r--include/hw/char/serial.h11
-rw-r--r--include/hw/char/stm32f2xx_usart.h4
12 files changed, 14 insertions, 41 deletions
diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h
index 5202f152b0..bb57532403 100644
--- a/include/hw/char/avr_usart.h
+++ b/include/hw/char/avr_usart.h
@@ -58,9 +58,7 @@
#define USART_CSRC_CSZ0 (1 << 1)
#define TYPE_AVR_USART "avr-usart"
-typedef struct AVRUsartState AVRUsartState;
-DECLARE_INSTANCE_CHECKER(AVRUsartState, AVR_USART,
- TYPE_AVR_USART)
+OBJECT_DECLARE_SIMPLE_TYPE(AVRUsartState, AVR_USART)
struct AVRUsartState {
/* <private> */
diff --git a/include/hw/char/bcm2835_aux.h b/include/hw/char/bcm2835_aux.h
index a08795c47f..9e081793a0 100644
--- a/include/hw/char/bcm2835_aux.h
+++ b/include/hw/char/bcm2835_aux.h
@@ -14,9 +14,7 @@
#include "qom/object.h"
#define TYPE_BCM2835_AUX "bcm2835-aux"
-typedef struct BCM2835AuxState BCM2835AuxState;
-DECLARE_INSTANCE_CHECKER(BCM2835AuxState, BCM2835_AUX,
- TYPE_BCM2835_AUX)
+OBJECT_DECLARE_SIMPLE_TYPE(BCM2835AuxState, BCM2835_AUX)
#define BCM2835_AUX_RX_FIFO_LEN 8
diff --git a/include/hw/char/cadence_uart.h b/include/hw/char/cadence_uart.h
index 1734f53541..e7f7cd8468 100644
--- a/include/hw/char/cadence_uart.h
+++ b/include/hw/char/cadence_uart.h
@@ -32,9 +32,7 @@
#define CADENCE_UART_R_MAX (0x48/4)
#define TYPE_CADENCE_UART "cadence_uart"
-typedef struct CadenceUARTState CadenceUARTState;
-DECLARE_INSTANCE_CHECKER(CadenceUARTState, CADENCE_UART,
- TYPE_CADENCE_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(CadenceUARTState, CADENCE_UART)
struct CadenceUARTState {
/*< private >*/
diff --git a/include/hw/char/cmsdk-apb-uart.h b/include/hw/char/cmsdk-apb-uart.h
index 2c3869aa16..9daff0eeee 100644
--- a/include/hw/char/cmsdk-apb-uart.h
+++ b/include/hw/char/cmsdk-apb-uart.h
@@ -18,9 +18,7 @@
#include "qom/object.h"
#define TYPE_CMSDK_APB_UART "cmsdk-apb-uart"
-typedef struct CMSDKAPBUART CMSDKAPBUART;
-DECLARE_INSTANCE_CHECKER(CMSDKAPBUART, CMSDK_APB_UART,
- TYPE_CMSDK_APB_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBUART, CMSDK_APB_UART)
struct CMSDKAPBUART {
/*< private >*/
diff --git a/include/hw/char/digic-uart.h b/include/hw/char/digic-uart.h
index 01d406833d..f710a1a099 100644
--- a/include/hw/char/digic-uart.h
+++ b/include/hw/char/digic-uart.h
@@ -23,9 +23,7 @@
#include "qom/object.h"
#define TYPE_DIGIC_UART "digic-uart"
-typedef struct DigicUartState DigicUartState;
-DECLARE_INSTANCE_CHECKER(DigicUartState, DIGIC_UART,
- TYPE_DIGIC_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(DigicUartState, DIGIC_UART)
enum {
R_TX = 0x00,
diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h
index 5eaec507da..7e9482dee2 100644
--- a/include/hw/char/escc.h
+++ b/include/hw/char/escc.h
@@ -11,9 +11,7 @@
#define TYPE_ESCC "escc"
#define ESCC_SIZE 4
-typedef struct ESCCState ESCCState;
-DECLARE_INSTANCE_CHECKER(ESCCState, ESCC,
- TYPE_ESCC)
+OBJECT_DECLARE_SIMPLE_TYPE(ESCCState, ESCC)
typedef enum {
escc_chn_a, escc_chn_b,
diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h
index 36eb75fc4c..03d19e3f6f 100644
--- a/include/hw/char/ibex_uart.h
+++ b/include/hw/char/ibex_uart.h
@@ -70,9 +70,7 @@ REG32(TIMEOUT_CTRL, 0x2c)
#define IBEX_UART_CLOCK 50000000 /* 50MHz clock */
#define TYPE_IBEX_UART "ibex-uart"
-typedef struct IbexUartState IbexUartState;
-DECLARE_INSTANCE_CHECKER(IbexUartState, IBEX_UART,
- TYPE_IBEX_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(IbexUartState, IBEX_UART)
struct IbexUartState {
/* <private> */
diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h
index 200f1ec33a..91c9894ad5 100644
--- a/include/hw/char/imx_serial.h
+++ b/include/hw/char/imx_serial.h
@@ -23,9 +23,7 @@
#include "qom/object.h"
#define TYPE_IMX_SERIAL "imx.serial"
-typedef struct IMXSerialState IMXSerialState;
-DECLARE_INSTANCE_CHECKER(IMXSerialState, IMX_SERIAL,
- TYPE_IMX_SERIAL)
+OBJECT_DECLARE_SIMPLE_TYPE(IMXSerialState, IMX_SERIAL)
#define URXD_CHARRDY (1<<15) /* character read is valid */
#define URXD_ERR (1<<14) /* Character has error */
diff --git a/include/hw/char/nrf51_uart.h b/include/hw/char/nrf51_uart.h
index 0cf3c4e328..561b6383c4 100644
--- a/include/hw/char/nrf51_uart.h
+++ b/include/hw/char/nrf51_uart.h
@@ -20,9 +20,7 @@
#define UART_SIZE 0x1000
#define TYPE_NRF51_UART "nrf51_soc.uart"
-typedef struct NRF51UARTState NRF51UARTState;
-DECLARE_INSTANCE_CHECKER(NRF51UARTState, NRF51_UART,
- TYPE_NRF51_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(NRF51UARTState, NRF51_UART)
REG32(UART_STARTRX, 0x000)
REG32(UART_STOPRX, 0x004)
diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h
index 80de4ecde6..a91ea50e11 100644
--- a/include/hw/char/pl011.h
+++ b/include/hw/char/pl011.h
@@ -22,9 +22,7 @@
#include "qom/object.h"
#define TYPE_PL011 "pl011"
-typedef struct PL011State PL011State;
-DECLARE_INSTANCE_CHECKER(PL011State, PL011,
- TYPE_PL011)
+OBJECT_DECLARE_SIMPLE_TYPE(PL011State, PL011)
/* This shares the same struct (and cast macro) as the base pl011 device */
#define TYPE_PL011_LUMINARY "pl011_luminary"
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 264f529a7f..db4f9af18c 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -89,14 +89,12 @@ struct SerialMM {
uint8_t regshift;
uint8_t endianness;
};
-typedef struct SerialMM SerialMM;
struct SerialIO {
SysBusDevice parent;
SerialState serial;
};
-typedef struct SerialIO SerialIO;
extern const VMStateDescription vmstate_serial;
extern const MemoryRegionOps serial_io_ops;
@@ -104,16 +102,13 @@ extern const MemoryRegionOps serial_io_ops;
void serial_set_frequency(SerialState *s, uint32_t frequency);
#define TYPE_SERIAL "serial"
-DECLARE_INSTANCE_CHECKER(SerialState, SERIAL,
- TYPE_SERIAL)
+OBJECT_DECLARE_SIMPLE_TYPE(SerialState, SERIAL)
#define TYPE_SERIAL_MM "serial-mm"
-DECLARE_INSTANCE_CHECKER(SerialMM, SERIAL_MM,
- TYPE_SERIAL_MM)
+OBJECT_DECLARE_SIMPLE_TYPE(SerialMM, SERIAL_MM)
#define TYPE_SERIAL_IO "serial-io"
-DECLARE_INSTANCE_CHECKER(SerialIO, SERIAL_IO,
- TYPE_SERIAL_IO)
+OBJECT_DECLARE_SIMPLE_TYPE(SerialIO, SERIAL_IO)
SerialMM *serial_mm_init(MemoryRegion *address_space,
hwaddr base, int regshift,
diff --git a/include/hw/char/stm32f2xx_usart.h b/include/hw/char/stm32f2xx_usart.h
index 1670c076d4..65bcc85470 100644
--- a/include/hw/char/stm32f2xx_usart.h
+++ b/include/hw/char/stm32f2xx_usart.h
@@ -54,9 +54,7 @@
#define USART_CR1_RE (1 << 2)
#define TYPE_STM32F2XX_USART "stm32f2xx-usart"
-typedef struct STM32F2XXUsartState STM32F2XXUsartState;
-DECLARE_INSTANCE_CHECKER(STM32F2XXUsartState, STM32F2XX_USART,
- TYPE_STM32F2XX_USART)
+OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXUsartState, STM32F2XX_USART)
struct STM32F2XXUsartState {
/* <private> */