Skip to content

Commit

Permalink
perf probe: Clean up probe_point_lazy_walker() return value
Browse files Browse the repository at this point in the history
Newer compilers (gcc 4.6) complains about:

        return ret < 0 ?: 0;

For the following reason:

  util/probe-finder.c: In function ‘probe_point_lazy_walker’:
  util/probe-finder.c:1331:18: error: the omitted middle operand in ?: will always be ‘true’, suggest explicit middle operand [-Werror=parentheses]

And indeed the return value is a somewhat obscure (but correct) value
of 'true', so return 'ret' instead - this is cleaner and unconfuses
GCC as well.

Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Peter Zijlstra <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ingo Molnar committed Mar 15, 2011
1 parent 137ee20 commit 5e814dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/probe-finder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ static int probe_point_lazy_walker(const char *fname, int lineno,
* Continue if no error, because the lazy pattern will match
* to other lines
*/
return ret < 0 ?: 0;
return ret < 0 ? ret : 0;
}

/* Find probe points from lazy pattern */
Expand Down

0 comments on commit 5e814dd

Please sign in to comment.