All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: uaccess: Reduce number of nested macros
Date: Thu, 8 Apr 2021 22:37:44 +0200	[thread overview]
Message-ID: <20210408203744.GA18538@alpha.franken.de> (raw)
In-Reply-To: <20210408194611.GA16189@lst.de>

On Thu, Apr 08, 2021 at 09:46:11PM +0200, Christoph Hellwig wrote:
> > +#define put_user(x, ptr)						\
> > +({									\
> > +	__typeof__(*(ptr)) __user *__p = (ptr);				\
> > +									\
> > +	might_fault();							\
> > +	access_ok(__p, sizeof(*__p)) ?					\
> > +		__put_user((x), __p) :					\
> > +		-EFAULT;						\
> 
> Why not merge this into a single line, which seems a little more
> readable:
> 
> 	access_ok(__p, sizeof(*__p)) ? __put_user((x), __p) : -EFAULT;	\

I just copied the riscv version ;-) I'll make it one line before applying.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

  reply	other threads:[~2021-04-08 20:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 18:14 [PATCH] MIPS: uaccess: Reduce number of nested macros Thomas Bogendoerfer
2021-04-08 19:46 ` Christoph Hellwig
2021-04-08 20:37   ` Thomas Bogendoerfer [this message]
2021-04-12 15:06 ` Thomas Bogendoerfer

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=20210408203744.GA18538@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.