Skip to contentSkip to conversation

PCI: utilize calculated results when detecting MSI features

PATCH New Jike Song 2 participants 3 messages Sep 9, 2008 – Sep 23, 2008 PCI

lore
Share & tools
lore

Jike Song

author
#0 lore raw

PATCH 1/1 PCI: utilize calculated results when detecting MSI features

author
#1 lore raw

PATCH 1/1 PCI: utilize calculated results when detecting MSI features

in function msi_capability_init, we can make use of the calculated results instead of calling is_mask_bit_support and is_64bit_address twice, in spite of the fact that they are macros.

---
 drivers/pci/msi.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/pci/msi.c +4 -6
index 4a10b56..d281201 100644
@@ -378,23 +378,21 @@ static int msi_capability_init(struct pci_dev *dev)
 	entry->msi_attrib.masked = 1;
 	entry->msi_attrib.default_irq = dev->irq;	/* Save IOAPIC IRQ */
 	entry->msi_attrib.pos = pos;
-	if (is_mask_bit_support(control)) {
+	if (entry->msi_attrib.maskbit) {
 		entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos,
-				is_64bit_address(control));
+				entry->msi_attrib.is_64);
 	}
 	entry->dev = dev;
 	if (entry->msi_attrib.maskbit) {
 		unsigned int maskbits, temp;
 		/* All MSIs are unmasked by default, Mask them all */
 		pci_read_config_dword(dev,
-			msi_mask_bits_reg(pos, is_64bit_address(control)),
+			msi_mask_bits_reg(pos, entry->msi_attrib.is_64),
 			&maskbits);
 		temp = (1 << multi_msi_capable(control));
 		temp = ((temp - 1) & ~temp);
 		maskbits |= temp;
-		pci_write_config_dword(dev,
-			msi_mask_bits_reg(pos, is_64bit_address(control)),
-			maskbits);
+		pci_write_config_dword(dev, entry->msi_attrib.is_64, maskbits);
 		entry->msi_attrib.maskbits_mask = temp;
 	}
 	list_add_tail(&entry->list, &dev->msi_list);
Signature · 1 line
1.5.6
Applied
#2 lore raw
Quoted 5 lines · Jike Song

in function msi_capability_init, we can make use of the calculated results instead of calling is_mask_bit_support and is_64bit_address twice, in spite of the fact that they are macros.

Applied to linux-next. Thanks.

Jesse