summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorMyron Stowe <myron.stowe@redhat.com>2012-06-01 15:16:31 -0600
committerBjorn Helgaas <bhelgaas@google.com>2012-06-11 20:40:57 -0600
commitcb97ae3485955401d637bd269b0d24d3cd3fd3ec (patch)
treeff55372324e4a4d0f9b1b59992b0d7dc29ce4aca /drivers/pci/pci.c
parentc32823f82b42abc1f08b365085862fd1d57c0b61 (diff)
downloadblackbird-obmc-linux-cb97ae3485955401d637bd269b0d24d3cd3fd3ec.tar.gz
blackbird-obmc-linux-cb97ae3485955401d637bd269b0d24d3cd3fd3ec.zip
PCI: remove redundant checking in PCI Express capability routines
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>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 847e0c35cdb7..766bb13bb0a3 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1994,7 +1994,7 @@ void pci_enable_ari(struct pci_dev *dev)
return;
bridge = dev->bus->self;
- if (!bridge || !pci_is_pcie(bridge))
+ if (!bridge)
return;
pos = pci_pcie_cap(bridge);
@@ -2054,9 +2054,6 @@ void pci_disable_ido(struct pci_dev *dev, unsigned long type)
int pos;
u16 ctrl;
- if (!pci_is_pcie(dev))
- return;
-
pos = pci_pcie_cap(dev);
if (!pos)
return;
@@ -2096,9 +2093,6 @@ int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type)
u16 ctrl;
int ret;
- if (!pci_is_pcie(dev))
- return -ENOTSUPP;
-
pos = pci_pcie_cap(dev);
if (!pos)
return -ENOTSUPP;
@@ -2149,9 +2143,6 @@ void pci_disable_obff(struct pci_dev *dev)
int pos;
u16 ctrl;
- if (!pci_is_pcie(dev))
- return;
-
pos = pci_pcie_cap(dev);
if (!pos)
return;
@@ -2174,9 +2165,6 @@ static bool pci_ltr_supported(struct pci_dev *dev)
int pos;
u32 cap;
- if (!pci_is_pcie(dev))
- return false;
-
pos = pci_pcie_cap(dev);
if (!pos)
return false;
OpenPOWER on IntegriCloud