Skip to content

Commit

Permalink
tracing: Remove filter allocator helper
Browse files Browse the repository at this point in the history
The __alloc_filter() function does nothing more that allocate the filter.
There's no reason to have it as a helper function.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (VMware) committed Mar 10, 2018
1 parent 559d421 commit c739970
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,14 +866,6 @@ void free_event_filter(struct event_filter *filter)
__free_filter(filter);
}

static struct event_filter *__alloc_filter(void)
{
struct event_filter *filter;

filter = kzalloc(sizeof(*filter), GFP_KERNEL);
return filter;
}

static int __alloc_preds(struct event_filter *filter, int n_preds)
{
struct filter_pred *pred;
Expand Down Expand Up @@ -1812,7 +1804,7 @@ static int replace_system_preds(struct trace_subsystem_dir *dir,

list_add_tail(&filter_item->list, &filter_list);

filter_item->filter = __alloc_filter();
filter_item->filter = kzalloc(sizeof(*filter), GFP_KERNEL);
if (!filter_item->filter)
goto fail_mem;
filter = filter_item->filter;
Expand Down Expand Up @@ -1886,7 +1878,7 @@ static int create_filter_start(char *filter_str, bool set_str,
WARN_ON_ONCE(*psp || *filterp);

/* allocate everything, and if any fails, free all and fail */
filter = __alloc_filter();
filter = kzalloc(sizeof(*filter), GFP_KERNEL);
if (filter && set_str)
err = replace_filter_string(filter, filter_str);

Expand Down

0 comments on commit c739970

Please sign in to comment.