Skip to content

Commit 706b585

Browse files
committed
powerpc/mpic_u3msi: Use msi_for_each-desc()
Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ab430e7 commit 706b585

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

arch/powerpc/sysdev/mpic_u3msi.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,12 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
104104
struct msi_desc *entry;
105105
irq_hw_number_t hwirq;
106106

107-
for_each_pci_msi_entry(entry, pdev) {
108-
if (!entry->irq)
109-
continue;
110-
107+
msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) {
111108
hwirq = virq_to_hw(entry->irq);
112109
irq_set_msi_desc(entry->irq, NULL);
113110
irq_dispose_mapping(entry->irq);
114111
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1);
115112
}
116-
117-
return;
118113
}
119114

120115
static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
@@ -136,7 +131,7 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
136131
return -ENXIO;
137132
}
138133

139-
for_each_pci_msi_entry(entry, pdev) {
134+
msi_for_each_desc(entry, &pdev->dev, MSI_DESC_NOTASSOCIATED) {
140135
hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap, 1);
141136
if (hwirq < 0) {
142137
pr_debug("u3msi: failed allocating hwirq\n");

0 commit comments

Comments
 (0)