Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtlwifi: remove unnecessary read of PCI_CAP_ID_EXP

The PCIE capability offset is saved during PCI bus walking. It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.

Also, remove unnecessary and unused #defines for PCI.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Jon Mason and committed by
John W. Linville
6a4ecc29 f05b6911

+1 -6
+1 -1
drivers/net/wireless/rtlwifi/pci.c
··· 390 390 u8 linkctrl_reg; 391 391 392 392 /*Link Control Register */ 393 - pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); 393 + pos = pci_pcie_cap(pdev); 394 394 pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg); 395 395 pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg; 396 396
-5
drivers/net/wireless/rtlwifi/pci.h
··· 75 75 #define PCI_CONF_ADDRESS 0x0CF8 /*PCI Configuration Space Address */ 76 76 #define PCI_CONF_DATA 0x0CFC /*PCI Configuration Space Data */ 77 77 78 - #define PCI_CLASS_BRIDGE_DEV 0x06 79 - #define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04 80 - #define PCI_CAPABILITY_ID_PCI_EXPRESS 0x10 81 - #define PCI_CAP_ID_EXP 0x10 82 - 83 78 #define U1DONTCARE 0xFF 84 79 #define U2DONTCARE 0xFFFF 85 80 #define U4DONTCARE 0xFFFFFFFF