There are a number of redundant pci_is_pcie() checks in various PCI
Express capabilities related routines like the following:
if (!pci_is_pcie(dev))
return false;
pos = pci_pcie_cap(dev);
if (!pos)
return false;
The current pci_is_pcie() implementation is merely:
static inline bool pci_is_pcie(struct pci_dev *dev)
{
return !!pci_pcie_cap(dev);
}
so we can just drop the pci_is_pcie() test in such cases.
Acked-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
return;
bridge = dev->bus->self;
- if (!bridge || !pci_is_pcie(bridge))
+ if (!bridge)
return;
pos = pci_pcie_cap(bridge);
int pos;
u16 ctrl;
- if (!pci_is_pcie(dev))
- return;
-
pos = pci_pcie_cap(dev);
if (!pos)
return;
u16 ctrl;
int ret;
- if (!pci_is_pcie(dev))
- return -ENOTSUPP;
-
pos = pci_pcie_cap(dev);
if (!pos)
return -ENOTSUPP;
int pos;
u16 ctrl;
- if (!pci_is_pcie(dev))
- return;
-
pos = pci_pcie_cap(dev);
if (!pos)
return;
int pos;
u32 cap;
- if (!pci_is_pcie(dev))
- return false;
-
pos = pci_pcie_cap(dev);
if (!pos)
return false;