Skip to content

Commit

Permalink
tracing: is_legal_op() can return boolean
Browse files Browse the repository at this point in the history
Make is_legal_op() return bool to improve readability due to this particular
function only using either one or zero as its return value.

No functional change.

Link: http://lkml.kernel.org/r/1443537816-5788-8-git-send-email-bywxiaobai@163.com

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Yaowei Bai authored and Steven Rostedt committed Nov 2, 2015
1 parent cdb2a0a commit 907bff9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,15 +973,15 @@ static bool is_string_field(struct ftrace_event_field *field)
field->filter_type == FILTER_PTR_STRING;
}

static int is_legal_op(struct ftrace_event_field *field, int op)
static bool is_legal_op(struct ftrace_event_field *field, int op)
{
if (is_string_field(field) &&
(op != OP_EQ && op != OP_NE && op != OP_GLOB))
return 0;
return false;
if (!is_string_field(field) && op == OP_GLOB)
return 0;
return false;

return 1;
return true;
}

static filter_pred_fn_t select_comparison_fn(int op, int field_size,
Expand Down

0 comments on commit 907bff9

Please sign in to comment.