diff options
author | Myron Stowe <myron.stowe@redhat.com> | 2012-06-01 17:16:31 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-11 22:40:57 -0400 |
commit | cb97ae3485955401d637bd269b0d24d3cd3fd3ec (patch) | |
tree | ff55372324e4a4d0f9b1b59992b0d7dc29ce4aca /drivers/pci/pci.c | |
parent | c32823f82b42abc1f08b365085862fd1d57c0b61 (diff) |
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.c | 14 |
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) | |||
1994 | return; | 1994 | return; |
1995 | 1995 | ||
1996 | bridge = dev->bus->self; | 1996 | bridge = dev->bus->self; |
1997 | if (!bridge || !pci_is_pcie(bridge)) | 1997 | if (!bridge) |
1998 | return; | 1998 | return; |
1999 | 1999 | ||
2000 | pos = pci_pcie_cap(bridge); | 2000 | pos = pci_pcie_cap(bridge); |
@@ -2054,9 +2054,6 @@ void pci_disable_ido(struct pci_dev *dev, unsigned long type) | |||
2054 | int pos; | 2054 | int pos; |
2055 | u16 ctrl; | 2055 | u16 ctrl; |
2056 | 2056 | ||
2057 | if (!pci_is_pcie(dev)) | ||
2058 | return; | ||
2059 | |||
2060 | pos = pci_pcie_cap(dev); | 2057 | pos = pci_pcie_cap(dev); |
2061 | if (!pos) | 2058 | if (!pos) |
2062 | return; | 2059 | return; |
@@ -2096,9 +2093,6 @@ int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type) | |||
2096 | u16 ctrl; | 2093 | u16 ctrl; |
2097 | int ret; | 2094 | int ret; |
2098 | 2095 | ||
2099 | if (!pci_is_pcie(dev)) | ||
2100 | return -ENOTSUPP; | ||
2101 | |||
2102 | pos = pci_pcie_cap(dev); | 2096 | pos = pci_pcie_cap(dev); |
2103 | if (!pos) | 2097 | if (!pos) |
2104 | return -ENOTSUPP; | 2098 | return -ENOTSUPP; |
@@ -2149,9 +2143,6 @@ void pci_disable_obff(struct pci_dev *dev) | |||
2149 | int pos; | 2143 | int pos; |
2150 | u16 ctrl; | 2144 | u16 ctrl; |
2151 | 2145 | ||
2152 | if (!pci_is_pcie(dev)) | ||
2153 | return; | ||
2154 | |||
2155 | pos = pci_pcie_cap(dev); | 2146 | pos = pci_pcie_cap(dev); |
2156 | if (!pos) | 2147 | if (!pos) |
2157 | return; | 2148 | return; |
@@ -2174,9 +2165,6 @@ static bool pci_ltr_supported(struct pci_dev *dev) | |||
2174 | int pos; | 2165 | int pos; |
2175 | u32 cap; | 2166 | u32 cap; |
2176 | 2167 | ||
2177 | if (!pci_is_pcie(dev)) | ||
2178 | return false; | ||
2179 | |||
2180 | pos = pci_pcie_cap(dev); | 2168 | pos = pci_pcie_cap(dev); |
2181 | if (!pos) | 2169 | if (!pos) |
2182 | return false; | 2170 | return false; |