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-next>] [day] [month] [year] [list]
Message-ID: <1471990593-27536-1-git-send-email-york.sun@nxp.com>
Date:   Tue, 23 Aug 2016 15:16:10 -0700
From:   York Sun <york.sun@....com>
To:     <linux-edac@...r.kernel.org>
CC:     <morbidrsa@...il.com>, <oss@...error.net>, <stuart.yoder@....com>,
        <bp@...en8.de>, York Sun <york.sun@....com>,
        Doug Thompson <dougthompson@...ssion.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] drivers/edac/fsl_ddr: Replace simple_strtoul with kstrtoul

Replace obsolete simple_strtoul() with kstrtoul().

Signed-off-by: York Sun <york.sun@....com>
---
 drivers/edac/fsl_ddr_edac.c | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c
index afade14..4ddf838 100644
--- a/drivers/edac/fsl_ddr_edac.c
+++ b/drivers/edac/fsl_ddr_edac.c
@@ -92,9 +92,15 @@ static ssize_t fsl_mc_inject_data_hi_store(struct device *dev,
 {
 	struct mem_ctl_info *mci = to_mci(dev);
 	struct fsl_mc_pdata *pdata = mci->pvt_info;
+	unsigned long val;
+	int rc;
+
 	if (isdigit(*data)) {
-		ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_HI,
-			  simple_strtoul(data, NULL, 0));
+		rc = kstrtoul(data, 0, &val);
+		if (rc)
+			return rc;
+
+		ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_HI, val);
 		return count;
 	}
 	return 0;
@@ -106,9 +112,15 @@ static ssize_t fsl_mc_inject_data_lo_store(struct device *dev,
 {
 	struct mem_ctl_info *mci = to_mci(dev);
 	struct fsl_mc_pdata *pdata = mci->pvt_info;
+	unsigned long val;
+	int rc;
+
 	if (isdigit(*data)) {
-		ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_LO,
-			  simple_strtoul(data, NULL, 0));
+		rc = kstrtoul(data, 0, &val);
+		if (rc)
+			return rc;
+
+		ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_LO, val);
 		return count;
 	}
 	return 0;
@@ -120,9 +132,15 @@ static ssize_t fsl_mc_inject_ctrl_store(struct device *dev,
 {
 	struct mem_ctl_info *mci = to_mci(dev);
 	struct fsl_mc_pdata *pdata = mci->pvt_info;
+	unsigned long val;
+	int rc;
+
 	if (isdigit(*data)) {
-		ddr_out32(pdata->mc_vbase + FSL_MC_ECC_ERR_INJECT,
-			  simple_strtoul(data, NULL, 0));
+		rc = kstrtoul(data, 0, &val);
+		if (rc)
+			return rc;
+
+		ddr_out32(pdata->mc_vbase + FSL_MC_ECC_ERR_INJECT, val);
 		return count;
 	}
 	return 0;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ