Message ID | f1627a12ac21980e14c9d2041013877d959d22cf.1338799935.git.jan.kiszka@siemens.com |
---|---|
State | New |
Headers | show |
On Mon, Jun 04, 2012 at 10:52:09AM +0200, Jan Kiszka wrote: > Align the bus traversal in pci_change_irq_level to other functions. They > use PCIBus:parent_dev to detect the root. > > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Applied. > --- > hw/pci.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index c1ebdde..893f89c 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -115,13 +115,13 @@ static inline void pci_set_irq_state(PCIDevice *d, int irq_num, int level) > static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change) > { > PCIBus *bus; > - for (;;) { > + > + do { > bus = pci_dev->bus; > irq_num = bus->map_irq(pci_dev, irq_num); > - if (bus->set_irq) > - break; > pci_dev = bus->parent_dev; > - } > + } while (pci_dev); > + > bus->irq_count[irq_num] += change; > bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0); > } > -- > 1.7.3.4
diff --git a/hw/pci.c b/hw/pci.c index c1ebdde..893f89c 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -115,13 +115,13 @@ static inline void pci_set_irq_state(PCIDevice *d, int irq_num, int level) static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change) { PCIBus *bus; - for (;;) { + + do { bus = pci_dev->bus; irq_num = bus->map_irq(pci_dev, irq_num); - if (bus->set_irq) - break; pci_dev = bus->parent_dev; - } + } while (pci_dev); + bus->irq_count[irq_num] += change; bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0); }
Align the bus traversal in pci_change_irq_level to other functions. They use PCIBus:parent_dev to detect the root. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- hw/pci.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)