[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210408203744.GA18538@alpha.franken.de>
Date: Thu, 8 Apr 2021 22:37:44 +0200
From: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To: Christoph Hellwig <hch@....de>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MIPS: uaccess: Reduce number of nested macros
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 ]
Powered by blists - more mailing lists