lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] MIPS: uaccess: Reduce number of nested macros
> +#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; \

Same for the get_user side.

Otherwise looks great:

Reviewed-by: Christoph Hellwig <hch@lst.de>

\
 
 \ /
  Last update: 2021-04-08 21:46    [W:0.039 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site