qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 01/13] pci: Refactor pci_change_irq_level


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH 01/13] pci: Refactor pci_change_irq_level
Date: Mon, 4 Jun 2012 10:52:09 +0200

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]