Skip to content

Commit

Permalink
tracing: Use pr_warn_once instead of open coded implementation
Browse files Browse the repository at this point in the history
Use pr_warn_once, instead of making an open coded implementation.

Link: http://lkml.kernel.org/r/513D8419.20400@huawei.com

Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
zhangwei(Jovi) authored and Steven Rostedt committed Mar 15, 2013
1 parent 6c43e55 commit 687c878
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -5205,8 +5205,6 @@ static inline int register_snapshot_cmd(void) { return 0; }

struct dentry *tracing_init_dentry_tr(struct trace_array *tr)
{
static int once;

if (tr->dir)
return tr->dir;

Expand All @@ -5216,11 +5214,8 @@ struct dentry *tracing_init_dentry_tr(struct trace_array *tr)
if (tr->flags & TRACE_ARRAY_FL_GLOBAL)
tr->dir = debugfs_create_dir("tracing", NULL);

if (!tr->dir && !once) {
once = 1;
pr_warning("Could not create debugfs directory 'tracing'\n");
return NULL;
}
if (!tr->dir)
pr_warn_once("Could not create debugfs directory 'tracing'\n");

return tr->dir;
}
Expand Down

0 comments on commit 687c878

Please sign in to comment.