PCI/MSI: Remove "pos" from the struct msi_desc msi_attrib
authorYijing Wang <wangyijing@huawei.com>
Tue, 23 Sep 2014 17:02:42 +0000 (11:02 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 1 Oct 2014 18:21:23 +0000 (12:21 -0600)
"msi_attrib.pos" is only used for MSI (not MSI-X), and we already cache the
MSI capability offset in "dev->msi_cap".

Remove "pos" from the struct msi_attrib and use "dev->msi_cap" directly.

[bhelgaas: changelog, fix whitespace]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/mips/pci/msi-octeon.c
drivers/pci/host/pcie-designware.c
drivers/pci/msi.c
include/linux/msi.h

index ab0c5d14c6f7289ac52554976ab7da9130cf4b41..63bbe07a1ccd24afb0857e82d88ea84052a669c3 100644 (file)
@@ -73,8 +73,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
         * wants.  Most devices only want 1, which will give
         * configured_private_bits and request_private_bits equal 0.
         */
-       pci_read_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS,
-                            &control);
+       pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
 
        /*
         * If the number of private bits has been configured then use
@@ -176,8 +175,7 @@ msi_irq_allocated:
        /* Update the number of IRQs the device has available to it */
        control &= ~PCI_MSI_FLAGS_QSIZE;
        control |= request_private_bits << 4;
-       pci_write_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS,
-                             control);
+       pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control);
 
        irq_set_msi_desc(irq, desc);
        write_msi_msg(irq, &msg);
index 52bd3a14356310195af1219e74b7e65091da6d88..fa2fa459ed90b35f7044f071dbe88945369d820e 100644 (file)
@@ -355,9 +355,8 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
                return -EINVAL;
        }
 
-       pci_read_config_word(pdev, desc->msi_attrib.pos+PCI_MSI_FLAGS,
-                               &msg_ctr);
-       msgvec = (msg_ctr&PCI_MSI_FLAGS_QSIZE) >> 4;
+       pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &msg_ctr);
+       msgvec = (msg_ctr & PCI_MSI_FLAGS_QSIZE) >> 4;
        if (msgvec == 0)
                msgvec = (msg_ctr & PCI_MSI_FLAGS_QMASK) >> 1;
        if (msgvec > 5)
index 97d6ef67a3c82967ea2f884c73c44bc9af983811..40699a2041b5876c0fee4a091a59965f194a91a5 100644 (file)
@@ -574,7 +574,6 @@ static struct msi_desc *msi_setup_entry(struct pci_dev *dev)
        entry->msi_attrib.entry_nr      = 0;
        entry->msi_attrib.maskbit       = !!(control & PCI_MSI_FLAGS_MASKBIT);
        entry->msi_attrib.default_irq   = dev->irq;     /* Save IOAPIC IRQ */
-       entry->msi_attrib.pos           = dev->msi_cap;
        entry->msi_attrib.multi_cap     = (control & PCI_MSI_FLAGS_QMASK) >> 1;
 
        if (control & PCI_MSI_FLAGS_64BIT)
@@ -678,7 +677,6 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
                entry->msi_attrib.is_64         = 1;
                entry->msi_attrib.entry_nr      = entries[i].entry;
                entry->msi_attrib.default_irq   = dev->irq;
-               entry->msi_attrib.pos           = dev->msix_cap;
                entry->mask_base                = base;
 
                list_add_tail(&entry->list, &dev->msi_list);
index 5a91c2d58ffd5bb935e84923a4db56f0a509aa81..44f4746d033b9afc0db8f81ddefa72e778a51efb 100644 (file)
@@ -29,7 +29,6 @@ struct msi_desc {
                __u8    multi_cap : 3;  /* log2 num of messages supported */
                __u8    maskbit : 1;    /* mask-pending bit supported ? */
                __u8    is_64   : 1;    /* Address size: 0=32bit 1=64bit */
-               __u8    pos;            /* Location of the msi capability */
                __u16   entry_nr;       /* specific enabled entry */
                unsigned default_irq;   /* default pre-assigned irq */
        } msi_attrib;