提交 3b1ea18d 编写于 作者: B Bjorn Helgaas 提交者: Len Brown

ACPI: PCI: use positive logic to simplify code

This doesn't change anything functionally; it just changes tests
so we test for success instead of failure.  This makes the code
read more easily and allows us to remove the "!entry" in the while
loop condition.
Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 beba8a64
...@@ -384,16 +384,15 @@ acpi_pci_irq_lookup(struct pci_dev *dev, int pin) ...@@ -384,16 +384,15 @@ acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
struct acpi_prt_entry *entry; struct acpi_prt_entry *entry;
entry = acpi_pci_irq_find_prt_entry(dev, pin); entry = acpi_pci_irq_find_prt_entry(dev, pin);
if (!entry) { if (entry) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No %s[%c] _PRT entry\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n",
pci_name(dev), pin_name(pin))); pci_name(dev), pin_name(pin)));
return NULL; return entry;
} }
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No %s[%c] _PRT entry\n",
pci_name(dev), pin_name(pin))); pci_name(dev), pin_name(pin)));
return NULL;
return entry;
} }
static struct acpi_prt_entry * static struct acpi_prt_entry *
...@@ -408,7 +407,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin) ...@@ -408,7 +407,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin)
* Attempt to derive an IRQ for this device from a parent bridge's * Attempt to derive an IRQ for this device from a parent bridge's
* PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge).
*/ */
while (!entry && bridge->bus->self) { while (bridge->bus->self) {
pin = (((pin - 1) + PCI_SLOT(bridge->devfn)) % 4) + 1; pin = (((pin - 1) + PCI_SLOT(bridge->devfn)) % 4) + 1;
bridge = bridge->bus->self; bridge = bridge->bus->self;
...@@ -425,18 +424,18 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin) ...@@ -425,18 +424,18 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin)
} }
entry = acpi_pci_irq_lookup(bridge, pin); entry = acpi_pci_irq_lookup(bridge, pin);
if (entry) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Derived GSI for %s INT %c from %s\n",
pci_name(dev), pin_name(orig_pin),
pci_name(bridge)));
return entry;
}
} }
if (!entry) { dev_warn(&dev->dev, "can't derive routing for PCI INT %c\n",
dev_warn(&dev->dev, "can't derive routing for PCI INT %c\n", pin_name(orig_pin));
pin_name(orig_pin)); return NULL;
return NULL;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derived GSI for %s INT %c from %s\n",
pci_name(dev), pin_name(orig_pin), pci_name(bridge)));
return entry;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册