Philippe Mathieu-Daudé <philmd@linaro.org> writes:
Audit the sysbus_init_irq() calls and manually convert
to sysbus_init_irqs() when a loop is involved.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/intc/loongarch_extioi.c | 3 +--
hw/intc/omap_intc.c | 3 +--
hw/pci-host/gpex.c | 2 +-
hw/timer/renesas_tmr.c | 9 +++------
4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/hw/intc/loongarch_extioi.c b/hw/intc/loongarch_extioi.c
index db941de20e..c579636215 100644
--- a/hw/intc/loongarch_extioi.c
+++ b/hw/intc/loongarch_extioi.c
@@ -275,8 +275,7 @@ static void loongarch_extioi_instance_init(Object *obj)
LoongArchExtIOI *s = LOONGARCH_EXTIOI(obj);
int cpu, pin;
- sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, EXTIOI_IRQS);
-
+ sysbus_init_irqs(dev, s->irq, EXTIOI_IRQS);
Commit message claims "when a loop is involved". No loop here. That
work was actually done in the previous patch:
diff --git a/hw/intc/loongarch_extioi.c b/hw/intc/loongarch_extioi.c
index 0e7a3e32f3..db941de20e 100644
--- a/hw/intc/loongarch_extioi.c
+++ b/hw/intc/loongarch_extioi.c
@@ -273,11 +273,9 @@ static void loongarch_extioi_instance_init(Object *obj)
{
SysBusDevice *dev = SYS_BUS_DEVICE(obj);
LoongArchExtIOI *s = LOONGARCH_EXTIOI(obj);
- int i, cpu, pin;
+ int cpu, pin;
- for (i = 0; i < EXTIOI_IRQS; i++) {
- sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]);
- }
+ sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, EXTIOI_IRQS);
qdev_init_gpio_in(DEVICE(obj), extioi_setirq, EXTIOI_IRQS);
In this patch, you merely delete a superfluous type conversion that is
present even before your series.
Actually, there are more elsewhere. Coccinelle script
@@
typedef SysBusDevice;
SysBusDevice *dev;
@@
- SYS_BUS_DEVICE(dev)
+ dev
finds some in hw/arm/xlnx-versal.c and hw/rx/rx62n.c, too.
Would be nice to do this for every QOM type, but I don't know how
without duplicating the semantic patch for each of them. There are
almost 150 uses os OBJECT_DECLARE_TYPE()...