From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Steven Rostedt <rostedt@goodmis.org>,
Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>,
Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 1/4] ring_buffer: Fix warning while ignoring cmpxchg return value
Date: Sat, 18 Jul 2009 03:16:58 -0400 [thread overview]
Message-ID: <1247901421-6389-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1247901421-6389-1-git-send-email-fweisbec@gmail.com>
From: Lai Jiangshan <laijs@cn.fujitsu.com>
kernel/trace/ring_buffer.c: In function 'rb_tail_page_update':
kernel/trace/ring_buffer.c:849: warning: value computed is not used
kernel/trace/ring_buffer.c:850: warning: value computed is not used
Add "(void)"s to fix this warning, because we don't need here to handle
the fail case of cmpxchg, it's fine if an interrupt already did the
job.
Changed from V1:
Add a comment(which is written by Steven) for it.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
kernel/trace/ring_buffer.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index e648ba4..51633d7 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -845,9 +845,14 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
* This will only succeed if an interrupt did
* not come in and change it. In which case, we
* do not want to modify it.
+ *
+ * We add (void) to let the compiler know that we do not care
+ * about the return value of these functions. We use the
+ * cmpxchg to only update if an interrupt did not already
+ * do it for us. If the cmpxchg fails, we don't care.
*/
- local_cmpxchg(&next_page->write, old_write, val);
- local_cmpxchg(&next_page->entries, old_entries, eval);
+ (void)local_cmpxchg(&next_page->write, old_write, val);
+ (void)local_cmpxchg(&next_page->entries, old_entries, eval);
/*
* No need to worry about races with clearing out the commit.
--
1.6.2.3
next prev parent reply other threads:[~2009-07-18 7:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-18 7:16 [GIT PULL] tracing updates for 2.6.32 Frederic Weisbecker
2009-07-18 7:16 ` Frederic Weisbecker [this message]
2009-07-18 7:16 ` [PATCH 2/4] tracing/function: Simplify __ftrace_replace_code() Frederic Weisbecker
2009-07-18 7:17 ` [PATCH 3/4] tracing/trace_stack: Cleanup for trace_lookup_stack() Frederic Weisbecker
2009-07-18 7:17 ` [PATCH 4/4] tracing/function: Cleanup for function tracer Frederic Weisbecker
2009-07-18 8:57 ` [GIT PULL] tracing updates for 2.6.32 Ingo Molnar
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=1247901421-6389-2-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=xiaoguangrong@cn.fujitsu.com \
/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
Powered by JetHome