Commit 34737e26 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

uaccess: add generic __{get,put}_kernel_nofault



Nine architectures are still missing __{get,put}_kernel_nofault:
alpha, ia64, microblaze, nds32, nios2, openrisc, sh, sparc32, xtensa.

Add a generic version that lets everything use the normal
copy_{from,to}_kernel_nofault() code based on these, removing the last
use of get_fs()/set_fs() from architecture-independent code.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 90997c12
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -476,8 +476,6 @@ do { \
	: "r" (x), "i" (-EFAULT)				\
	: "cc")

#define HAVE_GET_KERNEL_NOFAULT

#define __get_kernel_nofault(dst, src, type, err_label)			\
do {									\
	const type *__pk_ptr = (src);					\
+0 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
#include <asm/memory.h>
#include <asm/extable.h>

#define HAVE_GET_KERNEL_NOFAULT

/*
 * Test whether a block of memory is a valid user space address.
 * Returns 1 if the range is valid, 0 otherwise.
+0 −2
Original line number Diff line number Diff line
@@ -390,8 +390,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
#define INLINE_COPY_FROM_USER
#define INLINE_COPY_TO_USER

#define HAVE_GET_KERNEL_NOFAULT

#define __get_kernel_nofault(dst, src, type, err_label)			\
do {									\
	type *__gk_dst = (type *)(dst);					\
+0 −2
Original line number Diff line number Diff line
@@ -296,8 +296,6 @@ struct __large_struct { unsigned long buf[100]; };
	(val) = __gu_tmp.t;						\
}

#define HAVE_GET_KERNEL_NOFAULT

#define __get_kernel_nofault(dst, src, type, err_label)			\
do {									\
	int __gu_err;							\
+0 −1
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@ struct exception_table_entry {
	(val) = (__force __typeof__(*(ptr))) __gu_val;	\
}

#define HAVE_GET_KERNEL_NOFAULT
#define __get_kernel_nofault(dst, src, type, err_label)	\
{							\
	type __z;					\
Loading