[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/25] hw/irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE
From: |
Peter Maydell |
Subject: |
[PULL 23/25] hw/irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE() |
Date: |
Mon, 27 Feb 2023 14:01:00 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
QOM *DECLARE* macros expect a typedef as first argument,
not a structure. Replace 'struct IRQState' by 'IRQState'
to avoid when modifying the macros:
../hw/core/irq.c:29:1: error: declaration of anonymous struct must be a
definition
DECLARE_INSTANCE_CHECKER(struct IRQState, IRQ,
^
Use OBJECT_DECLARE_SIMPLE_TYPE instead of DECLARE_INSTANCE_CHECKER.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20230113200138.52869-3-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/core/irq.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/core/irq.c b/hw/core/irq.c
index 3623f711fe6..3f14e2dda74 100644
--- a/hw/core/irq.c
+++ b/hw/core/irq.c
@@ -26,8 +26,7 @@
#include "hw/irq.h"
#include "qom/object.h"
-DECLARE_INSTANCE_CHECKER(struct IRQState, IRQ,
- TYPE_IRQ)
+OBJECT_DECLARE_SIMPLE_TYPE(IRQState, IRQ)
struct IRQState {
Object parent_obj;
@@ -68,7 +67,7 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void
*opaque, int n)
qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque, int n)
{
- struct IRQState *irq;
+ IRQState *irq;
irq = IRQ(object_new(TYPE_IRQ));
irq->handler = handler;
@@ -94,7 +93,7 @@ void qemu_free_irq(qemu_irq irq)
static void qemu_notirq(void *opaque, int line, int level)
{
- struct IRQState *irq = opaque;
+ IRQState *irq = opaque;
irq->handler(irq->opaque, irq->n, !level);
}
@@ -120,7 +119,7 @@ void qemu_irq_intercept_in(qemu_irq *gpio_in,
qemu_irq_handler handler, int n)
static const TypeInfo irq_type_info = {
.name = TYPE_IRQ,
.parent = TYPE_OBJECT,
- .instance_size = sizeof(struct IRQState),
+ .instance_size = sizeof(IRQState),
};
static void irq_register_types(void)
--
2.34.1
- [PULL 25/25] hw: Replace qemu_or_irq typedef by OrIRQState, (continued)
- [PULL 25/25] hw: Replace qemu_or_irq typedef by OrIRQState, Peter Maydell, 2023/02/27
- [PULL 09/25] target/arm: Move regime_using_lpae_format into internal.h, Peter Maydell, 2023/02/27
- [PULL 15/25] hw/char/pl011: Open-code pl011_luminary_create(), Peter Maydell, 2023/02/27
- [PULL 07/25] target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled, Peter Maydell, 2023/02/27
- [PULL 10/25] target/arm: Don't access TCG code when debugging with KVM, Peter Maydell, 2023/02/27
- [PULL 12/25] tests/avocado: add machine:none tag to version.py, Peter Maydell, 2023/02/27
- [PULL 03/25] target/arm: Wrap TCG-only code in debug_helper.c, Peter Maydell, 2023/02/27
- [PULL 16/25] hw/char/xilinx_uartlite: Expose XILINX_UARTLITE QOM type, Peter Maydell, 2023/02/27
- [PULL 20/25] hw/intc/armv7m_nvic: Use QOM cast CPU() macro, Peter Maydell, 2023/02/27
- [PULL 22/25] iothread: Remove unused IOThreadClass / IOTHREAD_CLASS, Peter Maydell, 2023/02/27
- [PULL 23/25] hw/irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE(),
Peter Maydell <=
- [PULL 06/25] target/arm: Move psci.c into the tcg directory, Peter Maydell, 2023/02/27
- [PULL 04/25] target/arm: move translate modules to tcg/, Peter Maydell, 2023/02/27
- [PULL 11/25] cpu-defs.h: Expose CPUTLBEntryFull to non-TCG code, Peter Maydell, 2023/02/27
- [PULL 13/25] hw/gpio/max7310: Simplify max7310_realize(), Peter Maydell, 2023/02/27
- [PULL 19/25] hw/timer/cmsdk-apb-timer: Remove unused 'qdev-properties.h' header, Peter Maydell, 2023/02/27
- [PULL 18/25] hw/char/cmsdk-apb-uart: Open-code cmsdk_apb_uart_create(), Peter Maydell, 2023/02/27
- [PULL 24/25] hw/or-irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE(), Peter Maydell, 2023/02/27
- Re: [PULL 00/25] target-arm queue, Peter Maydell, 2023/02/27