diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-21 15:13:02 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-29 01:23:19 +0300 |
commit | ec022681a4201006a5bcb1a01401591a326b659c (patch) | |
tree | 18f8f80fca5bc62140dcdf41b4af184987d7e040 | |
parent | ca282f69738161ca1ac2e13b2c1b283be82ffb4b (diff) | |
download | linux-ec022681a4201006a5bcb1a01401591a326b659c.tar.xz |
alpha: switch to RAW_COPY_USER
copy_{to,from}_user() uninlined. We can go back to inlined variants,
if we want to...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/alpha/Kconfig | 1 | ||||
-rw-r--r-- | arch/alpha/include/asm/uaccess.h | 33 |
2 files changed, 7 insertions, 27 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 0e49d39ea74a..1be5f61dc630 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -26,6 +26,7 @@ config ALPHA select ODD_RT_SIGACTION select OLD_SIGSUSPEND select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67 + select ARCH_HAS_RAW_COPY_USER help The Alpha is a 64-bit general-purpose processor designed and marketed by the Digital Equipment Corporation of blessed memory, diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h index 9557c12823a9..7b82dc9a8556 100644 --- a/arch/alpha/include/asm/uaccess.h +++ b/arch/alpha/include/asm/uaccess.h @@ -300,37 +300,16 @@ __asm__ __volatile__("1: stb %r2,%1\n" \ extern long __copy_user(void *to, const void *from, long len); -#define __copy_to_user(to, from, n) \ -({ \ - __chk_user_ptr(to); \ - __copy_user((__force void *)(to), (from), (n)); \ -}) -#define __copy_from_user(to, from, n) \ -({ \ - __chk_user_ptr(from); \ - __copy_user((to), (__force void *)(from), (n)); \ -}) - -#define __copy_to_user_inatomic __copy_to_user -#define __copy_from_user_inatomic __copy_from_user - -extern inline long -copy_to_user(void __user *to, const void *from, long n) +static inline unsigned long +raw_copy_from_user(void *to, const void __user *from, unsigned long len) { - if (likely(__access_ok((unsigned long)to, n))) - n = __copy_user((__force void *)to, from, n); - return n; + return __copy_user(to, (__force const void *)from, len); } -extern inline long -copy_from_user(void *to, const void __user *from, long n) +static inline unsigned long +raw_copy_to_user(void __user *to, const void *from, unsigned long len) { - long res = n; - if (likely(__access_ok((unsigned long)from, n))) - res = __copy_from_user_inatomic(to, from, n); - if (unlikely(res)) - memset(to + (n - res), 0, res); - return res; + return __copy_user((__force void *)to, from, len); } extern long __clear_user(void __user *to, long len); |