mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] make WRITE_ONCE return void
Date: Fri, 8 Jul 2016 10:02:03 +0200	[thread overview]
Message-ID: <20160708080203.GW30921@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160707222008.GE31678@p183.telecom.by>

On Fri, Jul 08, 2016 at 01:20:08AM +0300, Alexey Dobriyan wrote:
> Currently WRITE_ONCE is used as if it returns void. Let's codify this
> before somebody tries to be smarter than necessary.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  include/linux/compiler.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -301,7 +301,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
>  	union { typeof(x) __val; char __c[1]; } __u =	\
>  		{ .__val = (__force typeof(x)) (val) }; \
>  	__write_once_size(&(x), __u.__c, sizeof(x));	\
> -	__u.__val;					\
> +	(void)0;					\
>  })

Why then still use the statement expression? Would it not make more
sense to change it into the regular do { } while (0) form if you want to
remove the return semantics?

  reply	other threads:[~2016-07-08  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 22:20 Alexey Dobriyan
2016-07-08  8:02 ` Peter Zijlstra [this message]
2016-07-08 10:20   ` Alexey Dobriyan

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=20160708080203.GW30921@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®