Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ede9c1fa50e01a8222217d4606bcbc44cd68f1a Commit: 7ede9c1fa50e01a8222217d4606bcbc44cd68f1a Parent: fc4afc7b2bdd81e2dbded5a8222676d3161758d3 Author: Michael Ellerman <[EMAIL PROTECTED]> AuthorDate: Thu Mar 22 21:51:34 2007 +1100 Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]> CommitDate: Wed May 2 19:02:36 2007 -0700
MSI: Consolidate BUG_ON()s. When freeing MSIs and MSI-Xs, we BUG_ON() if the irq has not been freed, ie. if it still has an action. We can consolidate all of these BUG_ON()s into msi_free_irqs() as all the code paths lead there almost immediately anyway. Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]> Acked-by: Eric W. Biederman <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/msi.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 4f326f3..38e4c80 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -573,8 +573,6 @@ void pci_disable_msi(struct pci_dev* dev) return; } - BUG_ON(irq_has_action(dev->first_msi_irq)); - default_irq = entry->msi_attrib.default_irq; msi_free_irq(dev, dev->first_msi_irq); @@ -590,6 +588,8 @@ static int msi_free_irq(struct pci_dev* dev, int irq) int head, entry_nr, type; void __iomem *base; + BUG_ON(irq_has_action(irq)); + entry = get_irq_msi(irq); if (!entry || entry->dev != dev) { return -EINVAL; @@ -682,8 +682,6 @@ static void msix_free_all_irqs(struct pci_dev *dev) while (head != tail) { tail = get_irq_msi(irq)->link.tail; - BUG_ON(irq_has_action(irq)); - if (irq != head) msi_free_irq(dev, irq); irq = tail; @@ -723,10 +721,8 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev) if (!pci_msi_enable || !dev) return; - if (dev->msi_enabled) { - BUG_ON(irq_has_action(dev->first_msi_irq)); + if (dev->msi_enabled) msi_free_irq(dev, dev->first_msi_irq); - } if (dev->msix_enabled) msix_free_all_irqs(dev); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html