diff options
author | zhangwei(Jovi) <jovi.zhangwei@huawei.com> | 2013-03-11 15:13:29 +0800 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-03-15 13:22:05 -0400 |
commit | 687c878afb526a0c3117dbc408ca76ad80d689f7 (patch) | |
tree | 235c0d1a9e293dfecde5d28dc42ff51e9452df62 /kernel | |
parent | 6c43e554a2a5c1f2caf1733d46719bc58de3e37b (diff) |
tracing: Use pr_warn_once instead of open coded implementation
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 7f0e7fa6d62..bba1ba958ee 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -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; @@ -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; } |