tracing, function tracer: Clean up strstrip() usage
authorIngo Molnar <mingo@elte.hu>
Mon, 23 Nov 2009 10:03:28 +0000 (11:03 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 23 Nov 2009 10:04:07 +0000 (11:04 +0100)
Clean up strstrip() usage - which also addresses this build warning:

  kernel/trace/ftrace.c: In function 'ftrace_pid_write':
  kernel/trace/ftrace.c:3004: warning: ignoring return value of 'strstrip', declared with attribute warn_unused_result

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/ftrace.c

index 7f9b51e8184b4e2c8a662e0c1ec9833d00cbe39c..1dc101d09765584482d660967052a1663615af86 100644 (file)
@@ -2985,7 +2985,7 @@ static ssize_t
 ftrace_pid_write(struct file *filp, const char __user *ubuf,
                   size_t cnt, loff_t *ppos)
 {
-       char buf[64];
+       char buf[64], *tmp;
        long val;
        int ret;
 
@@ -3001,11 +3001,11 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
         * Allow "echo > set_ftrace_pid" or "echo -n '' > set_ftrace_pid"
         * to clean the filter quietly.
         */
-       strstrip(buf);
-       if (strlen(buf) == 0)
+       tmp = strstrip(buf);
+       if (strlen(tmp) == 0)
                return 1;
 
-       ret = strict_strtol(buf, 10, &val);
+       ret = strict_strtol(tmp, 10, &val);
        if (ret < 0)
                return ret;
 
@@ -3391,4 +3391,3 @@ void ftrace_graph_stop(void)
        ftrace_stop();
 }
 #endif
-