]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/MSI: leverage local variables
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Dec 2017 16:17:23 +0000 (17:17 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Dec 2017 16:17:23 +0000 (17:17 +0100)
... instead of using redundant calculations.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/msi.c

index 4652b98c2d95c63653a0f36fbfd17c06c5cc4953..095bd3cae799019a230e0530049b2d61ad2ca572 100644 (file)
@@ -446,8 +446,7 @@ static bool msi_set_mask_bit(struct irq_desc *desc, bool host, bool guest)
                 pdev->msix->warned = domid;
                 printk(XENLOG_G_WARNING
                        "cannot mask IRQ %d: masking MSI-X on Dom%d's %04x:%02x:%02x.%u\n",
-                       desc->irq, domid, pdev->seg, pdev->bus,
-                       PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
+                       desc->irq, domid, seg, bus, slot, func);
             }
         }
         pdev->msix->host_maskall = maskall;
@@ -1118,8 +1117,7 @@ static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc)
     if ( old_desc )
     {
         printk(XENLOG_ERR "irq %d already mapped to MSI-X on %04x:%02x:%02x.%u\n",
-               msi->irq, msi->seg, msi->bus,
-               PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
+               msi->irq, msi->seg, msi->bus, slot, func);
         return -EEXIST;
     }
 
@@ -1127,8 +1125,7 @@ static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc)
     if ( old_desc )
     {
         printk(XENLOG_WARNING "MSI already in use on %04x:%02x:%02x.%u\n",
-               msi->seg, msi->bus,
-               PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
+               msi->seg, msi->bus, slot, func);
         __pci_disable_msi(old_desc);
     }
 
@@ -1177,8 +1174,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
     {
         printk(XENLOG_WARNING
                "cannot disable IRQ %d: masking MSI-X on %04x:%02x:%02x.%u\n",
-               entry->irq, dev->seg, dev->bus,
-               PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+               entry->irq, seg, bus, slot, func);
         maskall = true;
     }
     dev->msix->host_maskall = maskall;
@@ -1376,8 +1372,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
     bogus:
             dprintk(XENLOG_ERR,
                     "Restore MSI for %04x:%02x:%02x:%u entry %u not set?\n",
-                    pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
-                    PCI_FUNC(pdev->devfn), i);
+                    pdev->seg, pdev->bus, slot, func, i);
             spin_unlock_irqrestore(&desc->lock, flags);
             if ( type == PCI_CAP_ID_MSIX )
                 pci_conf_write16(pdev->seg, pdev->bus, slot, func,
@@ -1441,8 +1436,7 @@ int pci_restore_msi_state(struct pci_dev *pdev)
             control = pci_conf_read16(pdev->seg, pdev->bus, slot, func, cpos) &
                       ~PCI_MSI_FLAGS_QSIZE;
             multi_msi_enable(control, entry->msi.nvec);
-            pci_conf_write16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
-                             PCI_FUNC(pdev->devfn), cpos, control);
+            pci_conf_write16(pdev->seg, pdev->bus, slot, func, cpos, control);
 
             msi_set_enable(pdev, 1);
         }