linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan <adobriyan@gmail.com>
Subject: [PATCH 05/45] kstrtox: kernel/trace/
Date: Sun,  5 Dec 2010 19:49:02 +0200	[thread overview]
Message-ID: <1291571382-2719-5-git-send-email-adobriyan@gmail.com> (raw)
In-Reply-To: <1291571382-2719-1-git-send-email-adobriyan@gmail.com>


Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 kernel/trace/ftrace.c              |    6 +++---
 kernel/trace/ring_buffer.c         |    2 +-
 kernel/trace/trace.c               |   16 ++++++++--------
 kernel/trace/trace_events.c        |    8 ++++----
 kernel/trace/trace_events_filter.c |    4 ++--
 kernel/trace/trace_functions.c     |    4 ++--
 kernel/trace/trace_kprobe.c        |   25 ++++++++++++-------------
 kernel/trace/trace_stack.c         |    4 ++--
 8 files changed, 34 insertions(+), 35 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f3dadae..537fd31 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -747,7 +747,7 @@ ftrace_profile_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -3053,7 +3053,7 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
 		   size_t cnt, loff_t *ppos)
 {
 	char buf[64], *tmp;
-	long val;
+	int val;
 	int ret;
 
 	if (cnt >= sizeof(buf))
@@ -3072,7 +3072,7 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
 	if (strlen(tmp) == 0)
 		return 1;
 
-	ret = strict_strtol(tmp, 10, &val);
+	ret = kstrtoint(tmp, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 9ed509a..9ad99a6 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -3965,7 +3965,7 @@ rb_simple_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c380612..8509b20 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -389,7 +389,7 @@ static int __init set_tracing_thresh(char *str)
 
 	if (!str)
 		return 0;
-	ret = strict_strtoul(str, 0, &threshhold);
+	ret = kstrtoul(str, 0, &threshhold);
 	if (ret < 0)
 		return 0;
 	tracing_thresh = threshhold * 1000;
@@ -2696,7 +2696,7 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -2957,7 +2957,7 @@ tracing_max_lat_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -3416,7 +3416,7 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -4069,7 +4069,7 @@ trace_options_write(struct file *filp, const char __user *ubuf, size_t cnt,
 			 loff_t *ppos)
 {
 	struct trace_option_dentry *topt = filp->private_data;
-	unsigned long val;
+	unsigned int val;
 	char buf[64];
 	int ret;
 
@@ -4081,7 +4081,7 @@ trace_options_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtouint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -4131,7 +4131,7 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
 {
 	long index = (long)filp->private_data;
 	char buf[64];
-	unsigned long val;
+	unsigned int val;
 	int ret;
 
 	if (cnt >= sizeof(buf))
@@ -4142,7 +4142,7 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtouint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 0725eea..c7039a2 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -480,7 +480,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 {
 	struct ftrace_event_call *call = filp->private_data;
 	char buf[64];
-	unsigned long val;
+	int val;
 	int ret;
 
 	if (cnt >= sizeof(buf))
@@ -491,7 +491,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -563,8 +563,8 @@ system_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 		    loff_t *ppos)
 {
 	const char *system = filp->private_data;
-	unsigned long val;
 	char buf[64];
+	int val;
 	ssize_t ret;
 
 	if (cnt >= sizeof(buf))
@@ -575,7 +575,7 @@ system_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 36d4010..f17f6a0 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -807,9 +807,9 @@ static int filter_add_pred(struct filter_parse_state *ps,
 			fn = filter_pred_pchar;
 	} else {
 		if (field->is_signed)
-			ret = strict_strtoll(pred->regex.pattern, 0, &val);
+			ret = kstrtoll(pred->regex.pattern, 0, &val);
 		else
-			ret = strict_strtoull(pred->regex.pattern, 0, &val);
+			ret = kstrtoull(pred->regex.pattern, 0, &val);
 		if (ret) {
 			parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0);
 			return -EINVAL;
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 16aee4d..2f0dab3 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -354,8 +354,8 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable)
 	 * We use the callback data field (which is a pointer)
 	 * as our counter.
 	 */
-	ret = strict_strtoul(number, 0, (unsigned long *)&count);
-	if (ret)
+	ret = kstrtoul(number, 0, (unsigned long *)&count);
+	if (ret < 0)
 		return ret;
 
  out_reg:
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 2dec9bc..e29849d 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -684,9 +684,8 @@ static int split_symbol_offset(char *symbol, unsigned long *offset)
 
 	tmp = strchr(symbol, '+');
 	if (tmp) {
-		/* skip sign because strict_strtol doesn't accept '+' */
-		ret = strict_strtoul(tmp + 1, 0, offset);
-		if (ret)
+		ret = kstrtoul(tmp, 0, offset);
+		if (ret < 0)
 			return ret;
 		*tmp = '\0';
 	} else
@@ -715,8 +714,10 @@ static int parse_probe_vars(char *arg, const struct fetch_type *t,
 			else
 				ret = -EINVAL;
 		} else if (isdigit(arg[5])) {
-			ret = strict_strtoul(arg + 5, 10, &param);
-			if (ret || param > PARAM_MAX_STACK)
+			ret = kstrtoul(arg + 5, 10, &param);
+			if (ret < 0)
+				return ret;
+			if (param > PARAM_MAX_STACK)
 				ret = -EINVAL;
 			else {
 				f->fn = t->fetch[FETCH_MTD_stack];
@@ -752,8 +753,8 @@ static int __parse_probe_arg(char *arg, const struct fetch_type *t,
 		break;
 	case '@':	/* memory or symbol */
 		if (isdigit(arg[1])) {
-			ret = strict_strtoul(arg + 1, 0, &param);
-			if (ret)
+			ret = kstrtoul(arg + 1, 0, &param);
+			if (ret < 0)
 				break;
 			f->fn = t->fetch[FETCH_MTD_memory];
 			f->data = (void *)param;
@@ -772,11 +773,9 @@ static int __parse_probe_arg(char *arg, const struct fetch_type *t,
 		if (!tmp)
 			break;
 		*tmp = '\0';
-		ret = strict_strtol(arg + 1, 0, &offset);
-		if (ret)
+		ret = kstrtol(arg, 0, &offset);
+		if (ret < 0)
 			break;
-		if (arg[0] == '-')
-			offset = -offset;
 		arg = tmp + 1;
 		tmp = strrchr(arg, ')');
 		if (tmp) {
@@ -948,8 +947,8 @@ static int create_trace_probe(int argc, char **argv)
 			return -EINVAL;
 		}
 		/* an address specified */
-		ret = strict_strtoul(&argv[1][0], 0, (unsigned long *)&addr);
-		if (ret) {
+		ret = kstrtoul(&argv[1][0], 0, (unsigned long *)&addr);
+		if (ret < 0) {
 			pr_info("Failed to parse address.\n");
 			return ret;
 		}
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 4c5dead..36ebd3b 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -153,7 +153,7 @@ static ssize_t
 stack_max_size_write(struct file *filp, const char __user *ubuf,
 		     size_t count, loff_t *ppos)
 {
-	long *ptr = filp->private_data;
+	unsigned long *ptr = filp->private_data;
 	unsigned long val, flags;
 	char buf[64];
 	int ret;
@@ -167,7 +167,7 @@ stack_max_size_write(struct file *filp, const char __user *ubuf,
 
 	buf[count] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
-- 
1.7.2.2


  parent reply	other threads:[~2010-12-05 17:58 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-05 17:48 [PATCH 01/45] kstrtox: converting strings to integers done (hopefully) right Alexey Dobriyan
2010-12-05 17:48 ` [PATCH 02/45] kstrtox: convert arch/x86/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 03/45] kstrtox: convert arch/arm/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 04/45] kstrtox: convert kernel/ Alexey Dobriyan
2010-12-05 17:49 ` Alexey Dobriyan [this message]
2010-12-05 17:49 ` [PATCH 06/45] kstrtox: convert mm/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 07/45] kstrtox: convert fs/fuse/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 08/45] kstrtox: convert fs/nfs/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 09/45] kstrtox: convert fs/proc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 10/45] kstrtox: convert security/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 11/45] kstrtox: convert block/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 12/45] kstrtox: convert drivers/acpi/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 13/45] kstrtox: convert drivers/ata/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 14/45] kstrtox: convert drivers/base/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 15/45] kstrtox: convert drivers/block/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 16/45] kstrtox: convert drivers/bluetooth/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 17/45] kstrtox: convert drivers/clocksource/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 18/45] kstrtox: convert drivers/edac/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 19/45] kstrtox: convert drivers/gpio/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 20/45] kstrtox: convert drivers/gpu/drm/nouveau/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 21/45] kstrtox: convert drivers/hid/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 22/45] kstrtox: convert drivers/hwmon/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 23/45] kstrtox: convert drivers/ide/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 24/45] kstrtox: convert drivers/infiniband/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 25/45] kstrtox: convert drivers/input/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 26/45] kstrtox: convert drivers/isdn/ Alexey Dobriyan
2010-12-06  0:10   ` Tilman Schmidt
2010-12-06 20:10     ` Alexey Dobriyan
2010-12-07 10:06       ` Tilman Schmidt
2010-12-05 17:49 ` [PATCH 27/45] kstrtox: convert drivers/leds/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 28/45] kstrtox: convert drivers/md/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 29/45] kstrtox: convert drivers/mfd/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 30/45] kstrtox: convert drivers/misc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 31/45] kstrtox: convert drivers/mmc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 32/45] kstrtox: convert drivers/net/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 33/45] kstrtox: convert drivers/net/wireless/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 34/45] kstrtox: convert drivers/pci/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 35/45] kstrtox: convert drivers/platform/x86/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 36/45] kstrtox: convert drivers/power/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 37/45] kstrtox: convert drivers/regulator/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 38/45] kstrtox: convert drivers/rtc/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 39/45] kstrtox: convert drivers/scsi/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 40/45] kstrtox: convert drivers/ssb/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 41/45] kstrtox: convert drivers/usb/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 42/45] kstrtox: convert drivers/video/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 43/45] kstrtox: convert drivers/w1/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 44/45] kstrtox: convert sound/ Alexey Dobriyan
2010-12-05 17:49 ` [PATCH 45/45] kstrtox: convert net/ Alexey Dobriyan
2010-12-06  0:25 ` [PATCH 01/45] kstrtox: converting strings to integers done (hopefully) right Jesper Juhl
2010-12-06 15:16   ` Alexey Dobriyan
2010-12-07  9:04     ` Arnd Bergmann
2010-12-07  9:32       ` Alexey Dobriyan
2010-12-07  9:45         ` Arnd Bergmann
2010-12-08  8:51           ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291571382-2719-5-git-send-email-adobriyan@gmail.com \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 05/45] kstrtox: kernel/trace/' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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