summaryrefslogtreecommitdiff
path: root/include/asm-generic/uaccess.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-04-05 19:15:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-26 12:11:01 -0400
commit701cac61d0250912b89cbc28589969530179099a (patch)
tree1e3f472d176af49a5b92054a922272b8046b4ff3 /include/asm-generic/uaccess.h
parenteea86b637a15bc4d4bd518b11330ac96baa6b73d (diff)
CONFIG_ARCH_HAS_RAW_COPY_USER is unconditional now
all architectures converted Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/asm-generic/uaccess.h')
-rw-r--r--include/asm-generic/uaccess.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index d65c311eb128..bbe4bb438e39 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -86,11 +86,7 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
static inline int __put_user_fn(size_t size, void __user *ptr, void *x)
{
-#ifdef CONFIG_ARCH_HAS_RAW_COPY_USER
return unlikely(raw_copy_to_user(ptr, x, size)) ? -EFAULT : 0;
-#else
- return unlikely(__copy_to_user(ptr, x, size)) ? -EFAULT : 0;
-#endif
}
#define __put_user_fn(sz, u, k) __put_user_fn(sz, u, k)
@@ -151,11 +147,7 @@ extern int __put_user_bad(void) __attribute__((noreturn));
#ifndef __get_user_fn
static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
{
-#ifdef CONFIG_ARCH_HAS_RAW_COPY_USER
return unlikely(raw_copy_from_user(x, ptr, size)) ? -EFAULT : 0;
-#else
- return unlikely(__copy_from_user(x, ptr, size)) ? -EFAULT : 0;
-#endif
}
#define __get_user_fn(sz, u, k) __get_user_fn(sz, u, k)
@@ -164,39 +156,6 @@ static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
extern int __get_user_bad(void) __attribute__((noreturn));
-#ifndef CONFIG_ARCH_HAS_RAW_COPY_USER
-
-#ifndef __copy_from_user_inatomic
-#define __copy_from_user_inatomic __copy_from_user
-#endif
-
-#ifndef __copy_to_user_inatomic
-#define __copy_to_user_inatomic __copy_to_user
-#endif
-
-static inline long copy_from_user(void *to,
- const void __user * from, unsigned long n)
-{
- unsigned long res = n;
- might_fault();
- if (likely(access_ok(VERIFY_READ, from, n)))
- res = __copy_from_user(to, from, n);
- if (unlikely(res))
- memset(to + (n - res), 0, res);
- return res;
-}
-
-static inline long copy_to_user(void __user *to,
- const void *from, unsigned long n)
-{
- might_fault();
- if (access_ok(VERIFY_WRITE, to, n))
- return __copy_to_user(to, from, n);
- else
- return n;
-}
-#endif
-
/*
* Copy a null terminated string from userspace.
*/