arch/x86/pci/irq.c: attempt to clean up code layout
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 20 Aug 2008 23:43:02 +0000 (16:43 -0700)
committerIngo Molnar <mingo@elte.hu>
Thu, 21 Aug 2008 08:12:01 +0000 (10:12 +0200)
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/pci/irq.c

index fec0123..d781cc4 100644 (file)
@@ -1041,35 +1041,44 @@ static void __init pcibios_fixup_irqs(void)
                if (io_apic_assign_pci_irqs) {
                        int irq;
 
-                       if (pin) {
-                               /*
-                                * interrupt pins are numbered starting
-                                * from 1
-                                */
-                               pin--;
-                               irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
-                                       PCI_SLOT(dev->devfn), pin);
-       /*
-        * Busses behind bridges are typically not listed in the MP-table.
-        * In this case we have to look up the IRQ based on the parent bus,
-        * parent slot, and pin number. The SMP code detects such bridged
-        * busses itself so we should get into this branch reliably.
-        */
-                               if (irq < 0 && dev->bus->parent) { /* go back to the bridge */
-                                       struct pci_dev *bridge = dev->bus->self;
-
-                                       pin = (pin + PCI_SLOT(dev->devfn)) % 4;
-                                       irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
-                                                       PCI_SLOT(bridge->devfn), pin);
-                                       if (irq >= 0)
-                                               dev_warn(&dev->dev, "using bridge %s INT %c to get IRQ %d\n",
-                                                        pci_name(bridge),
-                                                        'A' + pin, irq);
-                               }
-                               if (irq >= 0) {
-                                       dev_info(&dev->dev, "PCI->APIC IRQ transform: INT %c -> IRQ %d\n", 'A' + pin, irq);
-                                       dev->irq = irq;
-                               }
+                       if (!pin)
+                               continue;
+
+                       /*
+                        * interrupt pins are numbered starting from 1
+                        */
+                       pin--;
+                       irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
+                               PCI_SLOT(dev->devfn), pin);
+                       /*
+                        * Busses behind bridges are typically not listed in the
+                        * MP-table.  In this case we have to look up the IRQ
+                        * based on the parent bus, parent slot, and pin number.
+                        * The SMP code detects such bridged busses itself so we
+                        * should get into this branch reliably.
+                        */
+                       if (irq < 0 && dev->bus->parent) {
+                               /* go back to the bridge */
+                               struct pci_dev *bridge = dev->bus->self;
+                               int bus;
+
+                               pin = (pin + PCI_SLOT(dev->devfn)) % 4;
+                               bus = bridge->bus->number;
+                               irq = IO_APIC_get_PCI_irq_vector(bus,
+                                               PCI_SLOT(bridge->devfn), pin);
+                               if (irq >= 0)
+                                       dev_warn(&dev->dev,
+                                               "using bridge %s INT %c to "
+                                                       "get IRQ %d\n",
+                                                pci_name(bridge),
+                                                'A' + pin, irq);
+                       }
+                       if (irq >= 0) {
+                               dev_info(&dev->dev,
+                                       "PCI->APIC IRQ transform: INT %c "
+                                               "-> IRQ %d\n",
+                                       'A' + pin, irq);
+                               dev->irq = irq;
                        }
                }
 #endif