Skip to content

Commit

Permalink
powerpc/4xx/hsta: Rework MSI handling
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.359766435@linutronix.de
  • Loading branch information
Thomas Gleixner committed Dec 16, 2021
1 parent 2ca5e90 commit 85dabc2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/powerpc/platforms/4xx/hsta_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static int hsta_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
return -EINVAL;
}

for_each_pci_msi_entry(entry, dev) {
msi_for_each_desc(entry, &dev->dev, MSI_DESC_NOTASSOCIATED) {
irq = msi_bitmap_alloc_hwirqs(&ppc4xx_hsta_msi.bmp, 1);
if (irq < 0) {
pr_debug("%s: Failed to allocate msi interrupt\n",
Expand Down Expand Up @@ -105,10 +105,7 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev)
struct msi_desc *entry;
int irq;

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

msi_for_each_desc(entry, &dev->dev, MSI_DESC_ASSOCIATED) {
irq = hsta_find_hwirq_offset(entry->irq);

/* entry->irq should always be in irq_map */
Expand Down

0 comments on commit 85dabc2

Please sign in to comment.