Skip to contentSkip to conversation

x86: kernel/cpu/perf_event.c simple_strtoul cleanup

PATCH In review Shuah Khan 1 participant 2 messages Jun 11, 2012

Subsystems (2)
lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

PATCH 1/1 x86: kernel/cpu/perf_event.c simple_strtoul cleanup

Change set_attr_rdpmc() to call kstrtoul() instead of calling obsoleted simple_strtoul().

---
 arch/x86/kernel/cpu/perf_event.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event.c +6 -1
index e049d6d..2e51c82f 100644
@@ -1648,7 +1648,12 @@ static ssize_t set_attr_rdpmc(struct device *cdev,
 			      struct device_attribute *attr,
 			      const char *buf, size_t count)
 {
-	unsigned long val = simple_strtoul(buf, NULL, 0);
+	unsigned long val;
+	ssize_t ret;
+
+	ret = kstrtoul(buf, 0, &val);
+	if (ret)
+		return ret;
 
 	if (!!val != !!x86_pmu.attr_rdpmc) {
 		x86_pmu.attr_rdpmc = !!val;
Signature · 1 line
1.7.9.5
#1 lore raw

[tip:perf/core] perf/x86: Convert obsolete simple_strtoul() usage to kstrtoul()

Commit-ID:  e2b297fcf17fc03734e93387fb8195c782286b35
Gitweb:     http://git.kernel.org/tip/e2b297fcf17fc03734e93387fb8195c782286b35
Author:     Shuah Khan <[email protected]>
AuthorDate: Sun, 10 Jun 2012 21:13:41 -0600
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 11 Jun 2012 10:52:12 +0200

perf/x86: Convert obsolete simple_strtoul() usage to kstrtoul()

---
 arch/x86/kernel/cpu/perf_event.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +6 -1
index 000a474..766c76d 100644
@@ -1640,7 +1640,12 @@ static ssize_t set_attr_rdpmc(struct device *cdev,
 			      struct device_attribute *attr,
 			      const char *buf, size_t count)
 {
-	unsigned long val = simple_strtoul(buf, NULL, 0);
+	unsigned long val;
+	ssize_t ret;
+
+	ret = kstrtoul(buf, 0, &val);
+	if (ret)
+		return ret;
 
 	if (!!val != !!x86_pmu.attr_rdpmc) {
 		x86_pmu.attr_rdpmc = !!val;