Message ID | 20191213105921.9529-1-philmd@redhat.com |
---|---|
State | New |
Headers | show |
Series | hw/isa/isa-bus: Use ISA_NUM_IRQS instead of magic number | expand |
On 12/13/19 11:59 AM, Philippe Mathieu-Daudé wrote: > We have a definition for the number of ISA IRQs, use it. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/isa/isa-bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c > index 388800603b..1d79ed133c 100644 > --- a/hw/isa/isa-bus.c > +++ b/hw/isa/isa-bus.c > @@ -85,7 +85,7 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs) > qemu_irq isa_get_irq(ISADevice *dev, int isairq) > { > assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus); > - if (isairq < 0 || isairq > 15) { > + if (isairq < 0 || isairq > >= ISA_NUM_IRQS) { Oops, Pablo was quicker than patchew to notice this buggy patch =) I messed when copy/pasting from a bigger series :/ So no need to review further. > hw_error("isa irq %d invalid", isairq); > } > return isabus->irqs[isairq]; >
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 388800603b..1d79ed133c 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -85,7 +85,7 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs) qemu_irq isa_get_irq(ISADevice *dev, int isairq) { assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus); - if (isairq < 0 || isairq > 15) { + if (isairq < 0 || isairq > >= ISA_NUM_IRQS) { hw_error("isa irq %d invalid", isairq); } return isabus->irqs[isairq];
We have a definition for the number of ISA IRQs, use it. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/isa/isa-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)