summaryrefslogtreecommitdiffstats
path: root/sys/ofed
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-13 03:32:41 +0000
committerngie <ngie@FreeBSD.org>2015-12-13 03:32:41 +0000
commite8eb34fc0589c0b8d326f6f04957c31a5aa00e4b (patch)
tree8c7bf095705b83c5080fd6ac15577b79bcde1a25 /sys/ofed
parent34da0a9b5801ba5960911e7170eb4d0ed8751030 (diff)
downloadFreeBSD-src-e8eb34fc0589c0b8d326f6f04957c31a5aa00e4b.zip
FreeBSD-src-e8eb34fc0589c0b8d326f6f04957c31a5aa00e4b.tar.gz
MFC r291753:
Fix scope of bridge_header and bridge_pcix_cap in mthca_reset(..) They're only used in the __linux__ case Differential Revision: https://reviews.freebsd.org/D4332 Reported by: cppcheck Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c b/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c
index ab059a6..f571bd6 100644
--- a/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c
+++ b/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c
@@ -43,9 +43,13 @@ int mthca_reset(struct mthca_dev *mdev)
int i;
int err = 0;
u32 *hca_header = NULL;
+#ifdef __linux__
u32 *bridge_header = NULL;
+#endif
struct pci_dev *bridge = NULL;
+#ifdef __linux__
int bridge_pcix_cap = 0;
+#endif
int hca_pcie_cap = 0;
int hca_pcix_cap = 0;
@@ -195,6 +199,7 @@ int mthca_reset(struct mthca_dev *mdev)
}
good:
+#ifdef __linux__
/* Now restore the PCI headers */
if (bridge) {
if (pci_write_config_dword(bridge, bridge_pcix_cap + 0x8,
@@ -235,6 +240,7 @@ good:
goto out;
}
}
+#endif
if (hca_pcix_cap) {
if (pci_write_config_dword(mdev->pdev, hca_pcix_cap,
@@ -289,8 +295,8 @@ out:
#ifdef __linux__
if (bridge)
pci_dev_put(bridge);
-#endif
kfree(bridge_header);
+#endif
kfree(hca_header);
return err;
OpenPOWER on IntegriCloud