* [PATCH -tip] ring_buffer: fix warning
@ 2009-07-14 7:35 Lai Jiangshan
2009-07-14 14:15 ` Frederic Weisbecker
2009-07-15 8:17 ` [PATCH -tip] ring_buffer: fix warning (V2) Lai Jiangshan
0 siblings, 2 replies; 6+ messages in thread
From: Lai Jiangshan @ 2009-07-14 7:35 UTC (permalink / raw)
To: Ingo Molnar, Steven Rostedt, Frederic Weisbecker, LKML
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 a "(void)" to fix this warning.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index e648ba4..d371279 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -846,8 +846,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
* not come in and change it. In which case, we
* do not want to modify it.
*/
- 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.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -tip] ring_buffer: fix warning
2009-07-14 7:35 [PATCH -tip] ring_buffer: fix warning Lai Jiangshan
@ 2009-07-14 14:15 ` Frederic Weisbecker
2009-07-14 22:43 ` Steven Rostedt
2009-07-15 8:17 ` [PATCH -tip] ring_buffer: fix warning (V2) Lai Jiangshan
1 sibling, 1 reply; 6+ messages in thread
From: Frederic Weisbecker @ 2009-07-14 14:15 UTC (permalink / raw)
To: Lai Jiangshan; +Cc: Ingo Molnar, Steven Rostedt, LKML
On Tue, Jul 14, 2009 at 03:35:37PM +0800, Lai Jiangshan wrote:
>
> 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 a "(void)" to fix this warning.
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index e648ba4..d371279 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -846,8 +846,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
> * not come in and change it. In which case, we
> * do not want to modify it.
> */
> - 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.
Looks good. Indeed the rest of the path remains the same, whether the
interrupts have already won the race or not.
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -tip] ring_buffer: fix warning
2009-07-14 14:15 ` Frederic Weisbecker
@ 2009-07-14 22:43 ` Steven Rostedt
0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-07-14 22:43 UTC (permalink / raw)
To: Frederic Weisbecker; +Cc: Lai Jiangshan, Ingo Molnar, LKML
On Tue, 14 Jul 2009, Frederic Weisbecker wrote:
> On Tue, Jul 14, 2009 at 03:35:37PM +0800, Lai Jiangshan wrote:
> >
> > 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 a "(void)" to fix this warning.
> >
> > Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> > ---
> > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> > index e648ba4..d371279 100644
> > --- a/kernel/trace/ring_buffer.c
> > +++ b/kernel/trace/ring_buffer.c
> > @@ -846,8 +846,8 @@ static int rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,
> > * not come in and change it. In which case, we
> > * do not want to modify it.
> > */
> > - 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.
>
>
> Looks good. Indeed the rest of the path remains the same, whether the
> interrupts have already won the race or not.
Yes, but it needs a comment:
/*
* 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.
*/
Then you can have my:
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
>
> Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -tip] ring_buffer: fix warning (V2)
2009-07-14 7:35 [PATCH -tip] ring_buffer: fix warning Lai Jiangshan
2009-07-14 14:15 ` Frederic Weisbecker
@ 2009-07-15 8:17 ` Lai Jiangshan
2009-07-15 8:27 ` [PATCH -tip V2] ring_buffer: fix warning Lai Jiangshan
1 sibling, 1 reply; 6+ messages in thread
From: Lai Jiangshan @ 2009-07-15 8:17 UTC (permalink / raw)
To: Ingo Molnar, Steven Rostedt, Frederic Weisbecker, LKML
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.
Changed from V1:
Add a comment(which is written by Steven) for it.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
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.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -tip V2] ring_buffer: fix warning
2009-07-15 8:17 ` [PATCH -tip] ring_buffer: fix warning (V2) Lai Jiangshan
@ 2009-07-15 8:27 ` Lai Jiangshan
2009-07-16 16:10 ` Frederic Weisbecker
0 siblings, 1 reply; 6+ messages in thread
From: Lai Jiangshan @ 2009-07-15 8:27 UTC (permalink / raw)
To: Ingo Molnar, Steven Rostedt, Frederic Weisbecker, LKML
Sorry for missing Reviewed-by and Acked-by, so I resend it.
Subject: [PATCH -tip V2] ring_buffer: fix warning
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.
Changed from V1:
Add a comment(which is written by Steven) for it.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
---
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.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -tip V2] ring_buffer: fix warning
2009-07-15 8:27 ` [PATCH -tip V2] ring_buffer: fix warning Lai Jiangshan
@ 2009-07-16 16:10 ` Frederic Weisbecker
0 siblings, 0 replies; 6+ messages in thread
From: Frederic Weisbecker @ 2009-07-16 16:10 UTC (permalink / raw)
To: Lai Jiangshan; +Cc: Ingo Molnar, Steven Rostedt, LKML
On Wed, Jul 15, 2009 at 04:27:30PM +0800, Lai Jiangshan wrote:
> Sorry for missing Reviewed-by and Acked-by, so I resend it.
>
> Subject: [PATCH -tip V2] ring_buffer: fix warning
>
> 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.
>
> Changed from V1:
> Add a comment(which is written by Steven) for it.
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
> Acked-by: Steven Rostedt <rostedt@goodmis.org>
Queued for .32, thanks!
> ---
> 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.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-16 16:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 7:35 [PATCH -tip] ring_buffer: fix warning Lai Jiangshan
2009-07-14 14:15 ` Frederic Weisbecker
2009-07-14 22:43 ` Steven Rostedt
2009-07-15 8:17 ` [PATCH -tip] ring_buffer: fix warning (V2) Lai Jiangshan
2009-07-15 8:27 ` [PATCH -tip V2] ring_buffer: fix warning Lai Jiangshan
2009-07-16 16:10 ` Frederic Weisbecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox