Re: [PATCH] MIPS: uaccess: Reduce number of nested macros

From: Christoph Hellwig
Date: Thu Apr 08 2021 - 15:46:16 EST


> +#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@xxxxxx>