OSDN Git Service

PCI/MSI: Retrieve first MSI IRQ from msi_desc rather than pci_dev
authorYijing Wang <wangyijing@huawei.com>
Tue, 8 Jul 2014 02:08:55 +0000 (10:08 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 16 Jul 2014 20:44:49 +0000 (14:44 -0600)
Retrieve the first MSI IRQ to compute the MSI index from struct msi_desc
rather than the struct pci_dev to avoid an additional memory access.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/msi.c

index dd0a259..5bb9921 100644 (file)
@@ -235,7 +235,7 @@ static void msi_set_mask_bit(struct irq_data *data, u32 flag)
                msix_mask_irq(desc, flag);
                readl(desc->mask_base);         /* Flush write to device */
        } else {
-               unsigned offset = data->irq - desc->dev->irq;
+               unsigned offset = data->irq - desc->irq;
                msi_mask_irq(desc, 1 << offset, flag << offset);
        }
 }