Skip to content

Commit

Permalink
powerpc/mpic_u3msi: Use msi_for_each-desc()
Browse files Browse the repository at this point in the history
Replace the about to vanish iterators and make use of the filtering.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20211206210748.576162169@linutronix.de
  • Loading branch information
Thomas Gleixner committed Dec 16, 2021
1 parent ab430e7 commit 706b585
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions arch/powerpc/sysdev/mpic_u3msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,12 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
struct msi_desc *entry;
irq_hw_number_t hwirq;

for_each_pci_msi_entry(entry, pdev) {
if (!entry->irq)
continue;

msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) {
hwirq = virq_to_hw(entry->irq);
irq_set_msi_desc(entry->irq, NULL);
irq_dispose_mapping(entry->irq);
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1);
}

return;
}

static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
Expand All @@ -136,7 +131,7 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
return -ENXIO;
}

for_each_pci_msi_entry(entry, pdev) {
msi_for_each_desc(entry, &pdev->dev, MSI_DESC_NOTASSOCIATED) {
hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap, 1);
if (hwirq < 0) {
pr_debug("u3msi: failed allocating hwirq\n");
Expand Down

0 comments on commit 706b585

Please sign in to comment.