From owner-svn-src-all@freebsd.org Fri Dec 4 09:02:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01721A3F62C; Fri, 4 Dec 2015 09:02:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB8517A6; Fri, 4 Dec 2015 09:01:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB491wiE045604; Fri, 4 Dec 2015 09:01:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB491wkL045603; Fri, 4 Dec 2015 09:01:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512040901.tB491wkL045603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 4 Dec 2015 09:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291753 - head/sys/ofed/drivers/infiniband/hw/mthca X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 09:02:00 -0000 Author: ngie Date: Fri Dec 4 09:01:58 2015 New Revision: 291753 URL: https://svnweb.freebsd.org/changeset/base/291753 Log: 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 MFC after: 1 week Reported by: cppcheck Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Fri Dec 4 08:49:27 2015 (r291752) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Fri Dec 4 09:01:58 2015 (r291753) @@ -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;