lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426726150-983-3-git-send-email-dmitry.torokhov@gmail.com>
Date:	Wed, 18 Mar 2015 17:49:09 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Borislav Petkov <bp@...en8.de>,
	Doug Thompson <dougthompson@...ssion.com>,
	Tejun Heo <tj@...nel.org>
Cc:	linux-kernel@...r.kernel.org, linux-edac@...r.kernel.org,
	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
	Olof Johansson <olof@...om.net>,
	Arjan van de Ven <arjan@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Luis R . Rodriguez" <mcgrof@...e.com>
Subject: [PATCH 2/3] EDAC: amd64_edac: clean up remove_one_instance()

We can get much of data from driver-proivate structure so make use of
it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
---
 drivers/edac/amd64_edac.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index c0ebc06..d23dad9 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2774,7 +2774,7 @@ static int init_one_instance(struct pci_dev *F2)
 	if (!pvt)
 		goto err_ret;
 
-	pvt->mc_node_id	= nid;
+	pvt->mc_node_id = nid;
 	pvt->F2 = F2;
 
 	ret = -EINVAL;
@@ -2849,6 +2849,8 @@ static int init_one_instance(struct pci_dev *F2)
 
 	amd_register_ecc_decoder(decode_bus_error);
 
+	pci_set_drvdata(F2, pvt);
+
 	atomic_inc(&drv_instances);
 
 	return 0;
@@ -2890,22 +2892,15 @@ static int probe_one_instance(struct pci_dev *pdev,
 
 static void remove_one_instance(struct pci_dev *pdev)
 {
+	struct amd64_pvt *pvt = pci_get_drvdata(pdev);
 	struct mem_ctl_info *mci;
-	struct amd64_pvt *pvt;
-	u16 nid = amd_get_node_id(pdev);
-	struct pci_dev *F3 = node_to_amd_nb(nid)->misc;
-
-	mci = find_mci_by_dev(&pdev->dev);
-	WARN_ON(!mci);
 
 	/* Remove from EDAC CORE tracking list */
 	mci = edac_mc_del_mc(&pdev->dev);
-	if (!mci)
+	if (WARN_ON(!mci))
 		return;
 
-	pvt = mci->pvt_info;
-
-	restore_ecc_error_reporting(&pvt->ecc, nid, F3);
+	restore_ecc_error_reporting(&pvt->ecc, pvt->mc_node_id, pvt->F3);
 
 	free_mc_sibling_devs(pvt);
 
-- 
2.2.0.rc0.207.ga3a616c

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ