PCI: Refactor pci_is_bridge()
PATCH 2/2 PCI: Refactor pci_is_bridge()
Refactor pci_is_bridge(), check pci device hdr_type instead, and move it in include/linux/pci.h
--- include/linux/pci.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
include/linux/pci.h +6 -0
@@ -1649,6 +1649,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)return pci_pcie_cap (dev); } +static inline bool pci_is_bridge (struct pci_dev *dev) +{ +return dev->hdr_type ==PCI_HEADER_TYPE_BRIDGE || + dev->hdr_type ==PCI_HEADER_TYPE_CARDBUS ; +} +/** * pcie_caps_reg - get the PCIe Capabilities Register * @dev: PCI device
Signature · 1 line
1.7.1
Bjorn Helgaas
maintainerQuoted 13 lines · Yijing Wang
Refactor
pci_is_bridge(), check pci devicehdr_typeinstead, and move it ininclude/linux/pci.hSigned-off-by Yijing Wang <[email protected]>--- include/linux/pci.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)include/linux/pci.h +0
-0
include/linux/pci.h static inline bool pci_is_pcie(struct pci_dev *dev) · line 1656
Quoted 8 lines
include/linux/pci.h +5
-0@@ -1649,6 +1649,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)return pci_pcie_cap (dev); } +static inline bool pci_is_bridge (struct pci_dev *dev) +{ +return dev->hdr_type ==PCI_HEADER_TYPE_BRIDGE || + dev->hdr_type ==PCI_HEADER_TYPE_CARDBUS ; +}
There's no point in adding this unless somebody uses it (but I assume you probably meant to use it in acpi_pci_find_companion() as I mentioned).
Quoted 11 lines
include/linux/pci.h +0
-0/** * pcie_caps_reg - get the PCIe Capabilities Register * @dev: PCI device Signature · 7 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines
include/linux/pci.h static inline bool pci_is_pcie(struct pci_dev *dev) · line 1656
Quoted 5 lines
include/linux/pci.h +5
-0+static inline bool pci_is_bridge (struct pci_dev *dev) +{ +return dev->hdr_type ==PCI_HEADER_TYPE_BRIDGE || + dev->hdr_type ==PCI_HEADER_TYPE_CARDBUS ; +}There's no point in adding this unless somebody uses it (but I assume you probably meant to use it in
acpi_pci_find_companion()as I mentioned).
I will resend a complete patchset soon if you think it make sense.
Thanks!
Yijing.
Quoted 14 lines
Quoted 12 lines
/**
*pcie_caps_reg- get the PCIe Capabilities Register
* @dev: PCI deviceSignature · 7 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Thanks! Yijing