Skip to content

Commit 48c3c38

Browse files
YijingWangbjorn-helgaas
authored andcommitted
PCI/MSI: Remove "pos" from the struct msi_desc msi_attrib
"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>
1 parent 8105276 commit 48c3c38

4 files changed

Lines changed: 4 additions & 10 deletions

File tree

‎arch/mips/pci/msi-octeon.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
7373
* wants. Most devices only want 1, which will give
7474
* configured_private_bits and request_private_bits equal 0.
7575
*/
76-
pci_read_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS,
77-
&control);
76+
pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
7877

7978
/*
8079
* If the number of private bits has been configured then use
@@ -176,8 +175,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
176175
/* Update the number of IRQs the device has available to it */
177176
control &= ~PCI_MSI_FLAGS_QSIZE;
178177
control |= request_private_bits << 4;
179-
pci_write_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS,
180-
control);
178+
pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control);
181179

182180
irq_set_msi_desc(irq, desc);
183181
write_msi_msg(irq, &msg);

‎drivers/pci/host/pcie-designware.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,8 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
355355
return -EINVAL;
356356
}
357357

358-
pci_read_config_word(pdev, desc->msi_attrib.pos+PCI_MSI_FLAGS,
359-
&msg_ctr);
360-
msgvec = (msg_ctr&PCI_MSI_FLAGS_QSIZE) >> 4;
358+
pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &msg_ctr);
359+
msgvec = (msg_ctr & PCI_MSI_FLAGS_QSIZE) >> 4;
361360
if (msgvec == 0)
362361
msgvec = (msg_ctr & PCI_MSI_FLAGS_QMASK) >> 1;
363362
if (msgvec > 5)

‎drivers/pci/msi.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ static struct msi_desc *msi_setup_entry(struct pci_dev *dev)
574574
entry->msi_attrib.entry_nr = 0;
575575
entry->msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
576576
entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */
577-
entry->msi_attrib.pos = dev->msi_cap;
578577
entry->msi_attrib.multi_cap = (control & PCI_MSI_FLAGS_QMASK) >> 1;
579578

580579
if (control & PCI_MSI_FLAGS_64BIT)
@@ -678,7 +677,6 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
678677
entry->msi_attrib.is_64 = 1;
679678
entry->msi_attrib.entry_nr = entries[i].entry;
680679
entry->msi_attrib.default_irq = dev->irq;
681-
entry->msi_attrib.pos = dev->msix_cap;
682680
entry->mask_base = base;
683681

684682
list_add_tail(&entry->list, &dev->msi_list);

‎include/linux/msi.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct msi_desc {
2929
__u8 multi_cap : 3; /* log2 num of messages supported */
3030
__u8 maskbit : 1; /* mask-pending bit supported ? */
3131
__u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */
32-
__u8 pos; /* Location of the msi capability */
3332
__u16 entry_nr; /* specific enabled entry */
3433
unsigned default_irq; /* default pre-assigned irq */
3534
} msi_attrib;

0 commit comments

Comments
 (0)