diff options
author | Sean V Kelley <sean.v.kelley@intel.com> | 2020-11-20 16:10:27 -0800 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-12-04 11:18:58 -0600 |
commit | 480ef7cb9fcebda7b28cbed4f6cdcf0a02f4a6ca (patch) | |
tree | 7fcea99854eb67100e8a2172341d8ab27e325eec /drivers/pci/pcie/aer.c | |
parent | PCI/ERR: Simplify by using pci_upstream_bridge() (diff) | |
download | linux-dev-480ef7cb9fcebda7b28cbed4f6cdcf0a02f4a6ca.tar.xz linux-dev-480ef7cb9fcebda7b28cbed4f6cdcf0a02f4a6ca.zip |
PCI/ERR: Simplify by computing pci_pcie_type() once
Instead of calling pci_pcie_type(dev) twice, call it once and save the
result. No functional change intended.
Link: https://lore.kernel.org/r/20201121001036.8560-7-sean.v.kelley@intel.com
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # non-native/no RCEC
Signed-off-by: Sean V Kelley <sean.v.kelley@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/pci/pcie/aer.c')
-rw-r--r-- | drivers/pci/pcie/aer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 6fe2d4ef0635..0ba0b47ae751 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -1034,6 +1034,7 @@ EXPORT_SYMBOL_GPL(aer_recover_queue); */ int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info) { + int type = pci_pcie_type(dev); int aer = dev->aer_cap; int temp; @@ -1052,8 +1053,8 @@ int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info) &info->mask); if (!(info->status & ~info->mask)) return 0; - } else if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT || - pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM || + } else if (type == PCI_EXP_TYPE_ROOT_PORT || + type == PCI_EXP_TYPE_DOWNSTREAM || info->severity == AER_NONFATAL) { /* Link is still healthy for IO reads */ |