diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-10-24 22:38:59 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-10-30 04:29:13 -0400 |
commit | b06fe3e703f833866914c03c3fb0acc02385c824 (patch) | |
tree | 5596d1b4c52207bfab8a9652cafc213679714600 /hw | |
parent | 8acb3218b98c5f1bc02597ce5985fd02da7af0b1 (diff) | |
download | qemu-b06fe3e703f833866914c03c3fb0acc02385c824.zip qemu-b06fe3e703f833866914c03c3fb0acc02385c824.tar.gz qemu-b06fe3e703f833866914c03c3fb0acc02385c824.tar.bz2 |
hw/pci: Extract pci_bus_change_irq_level() from pci_change_irq_level()
Extract pci_bus_change_irq_level() from pci_change_irq_level() to
make it clearer it operates on the bus.
Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201024203900.3619498-2-f4bug@amsat.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/pci/pci.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 100c938..081ddca 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -248,6 +248,12 @@ static inline void pci_set_irq_state(PCIDevice *d, int irq_num, int level) d->irq_state |= level << irq_num; } +static void pci_bus_change_irq_level(PCIBus *bus, int irq_num, int change) +{ + bus->irq_count[irq_num] += change; + bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0); +} + static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change) { PCIBus *bus; @@ -258,8 +264,7 @@ static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change) break; pci_dev = bus->parent_dev; } - bus->irq_count[irq_num] += change; - bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0); + pci_bus_change_irq_level(bus, irq_num, change); } int pci_bus_get_irq_level(PCIBus *bus, int irq_num) |