public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: kernel/cpu/perf_event.c simple_strtoul cleanup
@ 2012-06-11  3:13 Shuah Khan
  2012-06-11  9:13 ` [tip:perf/core] perf/x86: Convert obsolete simple_strtoul() usage to kstrtoul() tip-bot for Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2012-06-11  3:13 UTC (permalink / raw)
  To: tglx, hpa; +Cc: shuahkhan, x86, LKML

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

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
---
 arch/x86/kernel/cpu/perf_event.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index e049d6d..2e51c82f 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -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;
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/core] perf/x86: Convert obsolete simple_strtoul() usage to kstrtoul()
  2012-06-11  3:13 [PATCH] x86: kernel/cpu/perf_event.c simple_strtoul cleanup Shuah Khan
@ 2012-06-11  9:13 ` tip-bot for Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Shuah Khan @ 2012-06-11  9:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fweisbec, shuahkhan, a.p.zijlstra, tglx

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

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

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1339384421.3025.8.camel@lorien2
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/perf_event.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 000a474..766c76d 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-11  9:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-11  3:13 [PATCH] x86: kernel/cpu/perf_event.c simple_strtoul cleanup Shuah Khan
2012-06-11  9:13 ` [tip:perf/core] perf/x86: Convert obsolete simple_strtoul() usage to kstrtoul() tip-bot for Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox