Skip to contentSkip to conversation

hw/adc/zynq-xadc: Use qemu_irq typedef

PATCH Applied Philippe Mathieu-Daudé 3 participants 3 messages May 9, 2022 – May 13, 2022 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/adc/zynq-xadc: Use qemu_irq typedef

From: Philippe Mathieu-Daudé <[email protected]>

Except hw/core/irq.c which implements the forward-declared opaque qemu_irq structure, hw/adc/zynq-xadc.{c,h} are the only files not using the typedef. Fix this single exception.

---
 hw/adc/zynq-xadc.c         | 4 ++--
 include/hw/adc/zynq-xadc.h | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
hw/adc/zynq-xadc.c +2 -2
index cfc7bab065..032e19cbd0 100644
@@ -86,7 +86,7 @@ static void zynq_xadc_update_ints(ZynqXADCState *s)
         s->regs[INT_STS] |= INT_DFIFO_GTH;
     }
 
-    qemu_set_irq(s->qemu_irq, !!(s->regs[INT_STS] & ~s->regs[INT_MASK]));
+    qemu_set_irq(s->irq, !!(s->regs[INT_STS] & ~s->regs[INT_MASK]));
 }
 
 static void zynq_xadc_reset(DeviceState *d)
@@ -262,7 +262,7 @@ static void zynq_xadc_init(Object *obj)
     memory_region_init_io(&s->iomem, obj, &xadc_ops, s, "zynq-xadc",
                           ZYNQ_XADC_MMIO_SIZE);
     sysbus_init_mmio(sbd, &s->iomem);
-    sysbus_init_irq(sbd, &s->qemu_irq);
+    sysbus_init_irq(sbd, &s->irq);
 }
 
 static const VMStateDescription vmstate_zynq_xadc = {
include/hw/adc/zynq-xadc.h +1 -2
index 2017b7a803..c10cc4c379 100644
@@ -39,8 +39,7 @@ struct ZynqXADCState {
     uint16_t xadc_dfifo[ZYNQ_XADC_FIFO_DEPTH];
     uint16_t xadc_dfifo_entries;
 
-    struct IRQState *qemu_irq;
-
+    qemu_irq irq;
 };
 
 #endif /* ZYNQ_XADC_H */
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

Except hw/core/irq.c which implements the forward-declared opaque qemu_irq structure, hw/adc/zynq-xadc.{c,h} are the only files not using the typedef. Fix this single exception.

$ git grep --files-with-matches --perl-regexp "\bIRQState\b"
hw/core/irq.c
include/qemu/typedefs.h
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 7 lines · Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

Except hw/core/irq.c which implements the forward-declared opaque qemu_irq structure, hw/adc/zynq-xadc.{c,h} are the only files not using the typedef. Fix this single exception.

Quoted 5 lines
---
 hw/adc/zynq-xadc.c         | 4 ++--
 include/hw/adc/zynq-xadc.h | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

Applied to target-arm.next, thanks.

-- PMM