From: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>
Subject: [PATCH 01/13] tracing: teach to use pr_warn_once
Date: Mon, 11 Mar 2013 15:13:29 +0800 [thread overview]
Message-ID: <513D8419.20400@huawei.com> (raw)
use pr_warn_once, instead implement it by our own.
Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
---
kernel/trace/trace.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c2e2c23..11cd56b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4588,8 +4588,6 @@ static struct dentry *d_tracer;
struct dentry *tracing_init_dentry(void)
{
- static int once;
-
if (d_tracer)
return d_tracer;
@@ -4598,11 +4596,8 @@ struct dentry *tracing_init_dentry(void)
d_tracer = debugfs_create_dir("tracing", NULL);
- if (!d_tracer && !once) {
- once = 1;
- pr_warning("Could not create debugfs directory 'tracing'\n");
- return NULL;
- }
+ if (!d_tracer)
+ pr_warn_once("Could not create debugfs directory 'tracing'\n");
return d_tracer;
}
@@ -4611,7 +4606,6 @@ static struct dentry *d_percpu;
static struct dentry *tracing_dentry_percpu(void)
{
- static int once;
struct dentry *d_tracer;
if (d_percpu)
@@ -4624,11 +4618,8 @@ static struct dentry *tracing_dentry_percpu(void)
d_percpu = debugfs_create_dir("per_cpu", d_tracer);
- if (!d_percpu && !once) {
- once = 1;
- pr_warning("Could not create debugfs directory 'per_cpu'\n");
- return NULL;
- }
+ if (!d_percpu)
+ pr_warn_once("Could not create debugfs directory 'per_cpu'\n");
return d_percpu;
}
--
1.7.9.7
reply other threads:[~2013-03-11 7:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=513D8419.20400@huawei.com \
--to=jovi.zhangwei@huawei.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox