Re: [RFC PATCH 2/3] arc: provide __{get,put}_kernel_nofault

Christoph Hellwig
2022-02-01T15:25:47Z

On Tue, Feb 01, 2022 at 05:55:37PM +0300, Sergey Matyukevich wrote:
> From: Sergey Matyukevich <sergey.matyukevich@synopsys.com>
>
> Implement the non-faulting kernel access helpers directly
> instead of using uaccess routines under set_fs(KERNEL_DS).
>
> Signed-off-by: Sergey Matyukevich <sergey.matyukevich@synopsys.com>
> ---
> arch/arc/include/asm/uaccess.h | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h
> index 9d1205bf90f1..c14b692a0a4e 100644
> --- a/arch/arc/include/asm/uaccess.h
> +++ b/arch/arc/include/asm/uaccess.h
> @@ -657,6 +657,28 @@ static inline unsigned long __arc_clear_user(void __user *to, unsigned long n)
> return res;
> }
>
> +#define HAVE_GET_KERNEL_NOFAULT
> +
> +#define __get_kernel_nofault(dst, src, type, err_label) \
> + do { \

Normal kernel style doesn't indent the do { } while inside of
function-like macros.

Otherwise this looks good.