* [PATCH] hw/isa/isa-bus: Use ISA_NUM_IRQS instead of magic number
@ 2019-12-13 10:59 Philippe Mathieu-Daudé
2019-12-13 13:22 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-13 10:59 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé
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) {
hw_error("isa irq %d invalid", isairq);
}
return isabus->irqs[isairq];
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hw/isa/isa-bus: Use ISA_NUM_IRQS instead of magic number
2019-12-13 10:59 [PATCH] hw/isa/isa-bus: Use ISA_NUM_IRQS instead of magic number Philippe Mathieu-Daudé
@ 2019-12-13 13:22 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-13 13:22 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini
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];
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-13 21:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 10:59 [PATCH] hw/isa/isa-bus: Use ISA_NUM_IRQS instead of magic number Philippe Mathieu-Daudé
2019-12-13 13:22 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.