Skip to content

Commit

Permalink
tracing/kprobes: Cleanup strict_strtol() using code
Browse files Browse the repository at this point in the history
Since strict_strtol() accepts minus digits started with '-', it doesn't
need to invert after converting.

Cc: 2nddept-manager@sdl.hitachi.co.jp
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20110204125153.9507.49335.stgit@ltc236.sdl.hitachi.co.jp>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Masami Hiramatsu authored and Arnaldo Carvalho de Melo committed Feb 7, 2011
1 parent f50c216 commit 76022db
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/trace/trace_kprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,16 +767,15 @@ static int __parse_probe_arg(char *arg, const struct fetch_type *t,
}
break;
case '+': /* deref memory */
arg++; /* Skip '+', because strict_strtol() rejects it. */
case '-':
tmp = strchr(arg, '(');
if (!tmp)
break;
*tmp = '\0';
ret = strict_strtol(arg + 1, 0, &offset);
ret = strict_strtol(arg, 0, &offset);
if (ret)
break;
if (arg[0] == '-')
offset = -offset;
arg = tmp + 1;
tmp = strrchr(arg, ')');
if (tmp) {
Expand Down

0 comments on commit 76022db

Please sign in to comment.