Skip to content

Commit b83082e

Browse files
YijingWangdavem330
authored andcommitted
netxen: clean up unnecessary MSI/MSI-X capability find
PCI core will initialize device MSI/MSI-X capability in pci_msi_init_pci_dev(). So device driver should use pci_dev->msi_cap/msix_cap to determine whether the device support MSI/MSI-X instead of using pci_find_capability(pci_dev, PCI_CAP_ID_MSI/MSIX). Access to PCIe device config space again will consume more time. Signed-off-by: Yijing Wang <[email protected]> Cc: Manish Chopra <[email protected]> Cc: Sony Chacko <[email protected]> Cc: Rajesh Borundia <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 40b2956 commit b83082e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,16 +459,14 @@ static void netxen_pcie_strap_init(struct netxen_adapter *adapter)
459459
static void netxen_set_msix_bit(struct pci_dev *pdev, int enable)
460460
{
461461
u32 control;
462-
int pos;
463462

464-
pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
465-
if (pos) {
466-
pci_read_config_dword(pdev, pos, &control);
463+
if (pdev->msix_cap) {
464+
pci_read_config_dword(pdev, pdev->msix_cap, &control);
467465
if (enable)
468466
control |= PCI_MSIX_FLAGS_ENABLE;
469467
else
470468
control = 0;
471-
pci_write_config_dword(pdev, pos, control);
469+
pci_write_config_dword(pdev, pdev->msix_cap, control);
472470
}
473471
}
474472

0 commit comments

Comments
 (0)