aboutsummaryrefslogtreecommitdiff
path: root/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 /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 'hw/char')
-rw-r--r--hw/char/debugcon.c4
-rw-r--r--hw/char/exynos4210_uart.c4
-rw-r--r--hw/char/grlib_apbuart.c4
-rw-r--r--hw/char/ipoctal232.c3
-rw-r--r--hw/char/lm32_juart.c4
-rw-r--r--hw/char/lm32_uart.c4
-rw-r--r--hw/char/mcf_uart.c4
-rw-r--r--hw/char/milkymist-uart.c4
-rw-r--r--hw/char/parallel.c4
-rw-r--r--hw/char/serial-isa.c4
-rw-r--r--hw/char/serial-pci.c4
-rw-r--r--hw/char/spapr_vty.c4
-rw-r--r--hw/char/xilinx_uartlite.c4
13 files changed, 13 insertions, 38 deletions
diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index daaaca0f39..2a063ad72c 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -33,9 +33,7 @@
#include "qom/object.h"
#define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon"
-typedef struct ISADebugconState ISADebugconState;
-DECLARE_INSTANCE_CHECKER(ISADebugconState, ISA_DEBUGCON_DEVICE,
- TYPE_ISA_DEBUGCON_DEVICE)
+OBJECT_DECLARE_SIMPLE_TYPE(ISADebugconState, ISA_DEBUGCON_DEVICE)
//#define DEBUG_DEBUGCON
diff --git a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c
index b8ea34edbd..96afe3580f 100644
--- a/hw/char/exynos4210_uart.c
+++ b/hw/char/exynos4210_uart.c
@@ -139,9 +139,7 @@ typedef struct {
} Exynos4210UartFIFO;
#define TYPE_EXYNOS4210_UART "exynos4210.uart"
-typedef struct Exynos4210UartState Exynos4210UartState;
-DECLARE_INSTANCE_CHECKER(Exynos4210UartState, EXYNOS4210_UART,
- TYPE_EXYNOS4210_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210UartState, EXYNOS4210_UART)
struct Exynos4210UartState {
SysBusDevice parent_obj;
diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c
index 6fd88d83ad..3f80f6824e 100644
--- a/hw/char/grlib_apbuart.c
+++ b/hw/char/grlib_apbuart.c
@@ -73,9 +73,7 @@
#define FIFO_LENGTH 1024
-typedef struct UART UART;
-DECLARE_INSTANCE_CHECKER(UART, GRLIB_APB_UART,
- TYPE_GRLIB_APB_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(UART, GRLIB_APB_UART)
struct UART {
SysBusDevice parent_obj;
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 2c987df8ad..ad000a39b9 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -123,8 +123,7 @@ struct IPOctalState {
#define TYPE_IPOCTAL "ipoctal232"
-DECLARE_INSTANCE_CHECKER(IPOctalState, IPOCTAL,
- TYPE_IPOCTAL)
+OBJECT_DECLARE_SIMPLE_TYPE(IPOctalState, IPOCTAL)
static const VMStateDescription vmstate_scc2698_channel = {
.name = "scc2698_channel",
diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c
index 5723f2e189..b97aacba91 100644
--- a/hw/char/lm32_juart.c
+++ b/hw/char/lm32_juart.c
@@ -42,9 +42,7 @@ enum {
JRX_FULL = (1<<8),
};
-typedef struct LM32JuartState LM32JuartState;
-DECLARE_INSTANCE_CHECKER(LM32JuartState, LM32_JUART,
- TYPE_LM32_JUART)
+OBJECT_DECLARE_SIMPLE_TYPE(LM32JuartState, LM32_JUART)
struct LM32JuartState {
SysBusDevice parent_obj;
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index 624bc83c5f..0e8b4e46a3 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -95,9 +95,7 @@ enum {
};
#define TYPE_LM32_UART "lm32-uart"
-typedef struct LM32UartState LM32UartState;
-DECLARE_INSTANCE_CHECKER(LM32UartState, LM32_UART,
- TYPE_LM32_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(LM32UartState, LM32_UART)
struct LM32UartState {
SysBusDevice parent_obj;
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index f6baa3ce77..e6814faffb 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -35,11 +35,9 @@ struct mcf_uart_state {
qemu_irq irq;
CharBackend chr;
};
-typedef struct mcf_uart_state mcf_uart_state;
#define TYPE_MCF_UART "mcf-uart"
-DECLARE_INSTANCE_CHECKER(mcf_uart_state, MCF_UART,
- TYPE_MCF_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(mcf_uart_state, MCF_UART)
/* UART Status Register bits. */
#define MCF_UART_RxRDY 0x01
diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index 41204a0e28..1e83dbcafa 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -58,9 +58,7 @@ enum {
};
#define TYPE_MILKYMIST_UART "milkymist-uart"
-typedef struct MilkymistUartState MilkymistUartState;
-DECLARE_INSTANCE_CHECKER(MilkymistUartState, MILKYMIST_UART,
- TYPE_MILKYMIST_UART)
+OBJECT_DECLARE_SIMPLE_TYPE(MilkymistUartState, MILKYMIST_UART)
struct MilkymistUartState {
SysBusDevice parent_obj;
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index ddb14f3197..8b418abf71 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -93,9 +93,7 @@ typedef struct ParallelState {
} ParallelState;
#define TYPE_ISA_PARALLEL "isa-parallel"
-typedef struct ISAParallelState ISAParallelState;
-DECLARE_INSTANCE_CHECKER(ISAParallelState, ISA_PARALLEL,
- TYPE_ISA_PARALLEL)
+OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL)
struct ISAParallelState {
ISADevice parent_obj;
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index d4aad81a85..32c2fc0ebe 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -34,9 +34,7 @@
#include "migration/vmstate.h"
#include "qom/object.h"
-typedef struct ISASerialState ISASerialState;
-DECLARE_INSTANCE_CHECKER(ISASerialState, ISA_SERIAL,
- TYPE_ISA_SERIAL)
+OBJECT_DECLARE_SIMPLE_TYPE(ISASerialState, ISA_SERIAL)
struct ISASerialState {
ISADevice parent_obj;
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index f68948154e..b0520a5a09 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -40,11 +40,9 @@ struct PCISerialState {
SerialState state;
uint8_t prog_if;
};
-typedef struct PCISerialState PCISerialState;
#define TYPE_PCI_SERIAL "pci-serial"
-DECLARE_INSTANCE_CHECKER(PCISerialState, PCI_SERIAL,
- TYPE_PCI_SERIAL)
+OBJECT_DECLARE_SIMPLE_TYPE(PCISerialState, PCI_SERIAL)
static void serial_pci_realize(PCIDevice *dev, Error **errp)
{
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index dd6dd2d8c3..e726d4d915 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -18,11 +18,9 @@ struct SpaprVioVty {
uint32_t in, out;
uint8_t buf[VTERM_BUFSIZE];
};
-typedef struct SpaprVioVty SpaprVioVty;
#define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty"
-DECLARE_INSTANCE_CHECKER(SpaprVioVty, VIO_SPAPR_VTY_DEVICE,
- TYPE_VIO_SPAPR_VTY_DEVICE)
+OBJECT_DECLARE_SIMPLE_TYPE(SpaprVioVty, VIO_SPAPR_VTY_DEVICE)
static int vty_can_receive(void *opaque)
{
diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c
index 8e9f9cd9ec..2e773ec4c4 100644
--- a/hw/char/xilinx_uartlite.c
+++ b/hw/char/xilinx_uartlite.c
@@ -53,9 +53,7 @@
#define CONTROL_IE 0x10
#define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite"
-typedef struct XilinxUARTLite XilinxUARTLite;
-DECLARE_INSTANCE_CHECKER(XilinxUARTLite, XILINX_UARTLITE,
- TYPE_XILINX_UARTLITE)
+OBJECT_DECLARE_SIMPLE_TYPE(XilinxUARTLite, XILINX_UARTLITE)
struct XilinxUARTLite {
SysBusDevice parent_obj;