lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090716161055.GC8043@nowhere>
Date:	Thu, 16 Jul 2009 12:10:57 -0400
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -tip V2] ring_buffer: fix warning

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@...fujitsu.com>
> Reviewed-by: Frederic Weisbecker <fweisbec@...il.com>
> Acked-by: Steven Rostedt <rostedt@...dmis.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.
> 

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ