]> git.baikalelectronics.ru Git - kernel.git/commitdiff
x86/pci/xen: Use msi_for_each_desc()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 6 Dec 2021 22:51:20 +0000 (23:51 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 16 Dec 2021 21:22:18 +0000 (22:22 +0100)
Replace the about to vanish iterators.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20211206210748.198359105@linutronix.de
arch/x86/pci/xen.c

index ded0320534798a635b9f8ec63a62050ec18ccf86..9bb1e29411796344a471bb76ca6f85ee59ed6954 100644 (file)
@@ -184,7 +184,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
        if (ret)
                goto error;
        i = 0;
-       for_each_pci_msi_entry(msidesc, dev) {
+       msi_for_each_desc(msidesc, &dev->dev, MSI_DESC_NOTASSOCIATED) {
                irq = xen_bind_pirq_msi_to_irq(dev, msidesc, v[i],
                                               (type == PCI_CAP_ID_MSI) ? nvec : 1,
                                               (type == PCI_CAP_ID_MSIX) ?
@@ -235,7 +235,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
        if (type == PCI_CAP_ID_MSI && nvec > 1)
                return 1;
 
-       for_each_pci_msi_entry(msidesc, dev) {
+       msi_for_each_desc(msidesc, &dev->dev, MSI_DESC_NOTASSOCIATED) {
                pirq = xen_allocate_pirq_msi(dev, msidesc);
                if (pirq < 0) {
                        irq = -ENODEV;
@@ -270,7 +270,7 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
        int ret = 0;
        struct msi_desc *msidesc;
 
-       for_each_pci_msi_entry(msidesc, dev) {
+       msi_for_each_desc(msidesc, &dev->dev, MSI_DESC_NOTASSOCIATED) {
                struct physdev_map_pirq map_irq;
                domid_t domid;
 
@@ -389,11 +389,9 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev)
        struct msi_desc *msidesc;
        int i;
 
-       for_each_pci_msi_entry(msidesc, dev) {
-               if (msidesc->irq) {
-                       for (i = 0; i < msidesc->nvec_used; i++)
-                               xen_destroy_irq(msidesc->irq + i);
-               }
+       msi_for_each_desc(msidesc, &dev->dev, MSI_DESC_ASSOCIATED) {
+               for (i = 0; i < msidesc->nvec_used; i++)
+                       xen_destroy_irq(msidesc->irq + i);
        }
 }