[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0907141841440.32740@gandalf.stny.rr.com>
Date: Tue, 14 Jul 2009 18:43:40 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: Frederic Weisbecker <fweisbec@...il.com>
cc: Lai Jiangshan <laijs@...fujitsu.com>, Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -tip] ring_buffer: fix warning
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@...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@...dmis.org>
-- Steve
>
> Reviewed-by: Frederic Weisbecker <fweisbec@...il.com>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists