diff mbox series

[RFC,05/10] hw/isa/isa-bus: assert() if isa_get_irq() gets passed a NULL ISADevice

Message ID 20220627071611.8793-6-shentey@gmail.com (mailing list archive)
State New, archived
Headers show
Series Resolve isabus global | expand

Commit Message

Bernhard Beschow June 27, 2022, 7:16 a.m. UTC
Now that all call-sites have been fixed to pass non-NULL ISADevices, we can
assert() on NULL ISADevices to catch regressions.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/isa/isa-bus.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 0537a9f2c1..9e8b5da027 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -81,9 +81,10 @@  void isa_bus_irqs(ISABus *bus, qemu_irq *irqs)
  */
 qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq)
 {
-    assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus);
+    assert(dev);
     assert(isairq < ISA_NUM_IRQS);
-    return isabus->irqs[isairq];
+
+    return isa_bus_from_device(dev)->irqs[isairq];
 }
 
 void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq)