]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
m68k: switch to RAW_COPY_USER
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Mar 2017 12:50:56 +0000 (08:50 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 28 Mar 2017 22:23:41 +0000 (18:23 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/m68k/Kconfig
arch/m68k/include/asm/uaccess_mm.h
arch/m68k/include/asm/uaccess_no.h

index d140206d5d29242e72961a18216b9930a48853a8..7d345758ea1610c58a6ca8bf5c4263cd81e49da9 100644 (file)
@@ -22,6 +22,7 @@ config M68K
        select MODULES_USE_ELF_RELA
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
+       select ARCH_HAS_RAW_COPY_USER
 
 config RWSEM_GENERIC_SPINLOCK
        bool
index 931bbba449e232f07ee907e87be4c94d6f32f129..ef856ffeffdfca99ca091c0206717b4ef8da1e7a 100644 (file)
@@ -356,28 +356,23 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n)
        return res;
 }
 
-#define __copy_from_user(to, from, n)          \
-(__builtin_constant_p(n) ?                     \
- __constant_copy_from_user(to, from, n) :      \
- __generic_copy_from_user(to, from, n))
-
-#define __copy_to_user(to, from, n)            \
-(__builtin_constant_p(n) ?                     \
- __constant_copy_to_user(to, from, n) :                \
- __generic_copy_to_user(to, from, n))
-
-#define __copy_to_user_inatomic                __copy_to_user
-#define __copy_from_user_inatomic      __copy_from_user
+static inline unsigned long
+raw_copy_from_user(void *to, const void __user *from, unsigned long n)
+{
+       if (__builtin_constant_p(n))
+               return __constant_copy_from_user(to, from, n);
+       return __generic_copy_from_user(to, from, n);
+}
 
 static inline unsigned long
-copy_from_user(void *to, const void __user *from, unsigned long n)
+raw_copy_to_user(void __user *to, const void *from, unsigned long n)
 {
-       unsigned long res = __copy_from_user_inatomic(to, from, n);
-       if (unlikely(res))
-               memset(to + (n - res), 0, res);
-       return res;
+       if (__builtin_constant_p(n))
+               return __constant_copy_to_user(to, from, n);
+       return __generic_copy_to_user(to, from, n);
 }
-#define copy_to_user(to, from, n)      __copy_to_user(to, from, n)
+#define INLINE_COPY_FROM_USER
+#define INLINE_COPY_TO_USER
 
 #define user_addr_max() \
        (uaccess_kernel() ? ~0UL : TASK_SIZE)
index 3f7f54d5134ce8c23f79aa12bdb6c281ff337208..e482c3899ff13992345ea3bc91ad463723d0cd64 100644 (file)
@@ -101,13 +101,21 @@ extern int __get_user_bad(void);
                 : "=d" (x)                                     \
                 : "m" (*__ptr(ptr)))
 
-#define copy_from_user(to, from, n)            (memcpy(to, from, n), 0)
-#define copy_to_user(to, from, n)              (memcpy(to, from, n), 0)
+static inline unsigned long
+raw_copy_from_user(void *to, const void __user *from, unsigned long n)
+{
+       memcpy(to, (__force const void *)from, n);
+       return 0;
+}
 
-#define __copy_from_user(to, from, n) copy_from_user(to, from, n)
-#define __copy_to_user(to, from, n) copy_to_user(to, from, n)
-#define __copy_to_user_inatomic __copy_to_user
-#define __copy_from_user_inatomic __copy_from_user
+static inline unsigned long
+raw_copy_to_user(void __user *to, const void *from, unsigned long n)
+{
+       memcpy((__force void *)to, from, n);
+       return 0;
+}
+#define INLINE_COPY_FROM_USER
+#define INLINE_COPY_TO_USER
 
 /*
  * Copy a null terminated string from userspace.