summaryrefslogtreecommitdiff
path: root/arch/cris/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-03-28 08:18:37 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2017-03-29 01:23:31 +0300
commit0c7e9a870eb2a5db03780d7d3f83d0df7623a9c7 (patch)
tree1205373458941fc0c329d1258bacd530f6fdeda7 /arch/cris/include
parentb71f1bf57f995ae4ce0fe2f907604c841ca8493f (diff)
downloadlinux-0c7e9a870eb2a5db03780d7d3f83d0df7623a9c7.tar.xz
cris: switch to RAW_COPY_USER
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/cris/include')
-rw-r--r--arch/cris/include/asm/uaccess.h53
1 files changed, 11 insertions, 42 deletions
diff --git a/arch/cris/include/asm/uaccess.h b/arch/cris/include/asm/uaccess.h
index fc30fdae8786..0d473aec3066 100644
--- a/arch/cris/include/asm/uaccess.h
+++ b/arch/cris/include/asm/uaccess.h
@@ -336,64 +336,33 @@ static inline size_t clear_user(void __user *to, size_t n)
return __do_clear_user(to, n);
}
-static inline size_t copy_from_user(void *to, const void __user *from, size_t n)
+static inline unsigned long
+raw_copy_from_user(void *to, const void __user *from, unsigned long n)
{
- size_t res = n;
- if (likely(access_ok(VERIFY_READ, from, n))) {
- if (__builtin_constant_p(n))
- res = __constant_copy_from_user(to, from, n);
- else
- res = __copy_user_in(to, from, n);
- }
- if (unlikely(res))
- memset(to + n - res , 0, res);
- return res;
+ if (__builtin_constant_p(n))
+ return __constant_copy_from_user(to, from, n);
+ else
+ return __copy_user_in(to, from, n);
}
-static inline size_t copy_to_user(void __user *to, const void *from, size_t n)
+static inline unsigned long
+raw_copy_to_user(void __user *to, const void *from, unsigned long n)
{
- if (unlikely(!access_ok(VERIFY_WRITE, to, n)))
- return n;
if (__builtin_constant_p(n))
return __constant_copy_to_user(to, from, n);
else
return __copy_user(to, from, n);
}
-/* We let the __ versions of copy_from/to_user inline, because they're often
- * used in fast paths and have only a small space overhead.
- */
-
-static inline unsigned long
-__generic_copy_from_user_nocheck(void *to, const void __user *from,
- unsigned long n)
-{
- return __copy_user_in(to, from, n);
-}
-
-static inline unsigned long
-__generic_copy_to_user_nocheck(void __user *to, const void *from,
- unsigned long n)
-{
- return __copy_user(to, from, n);
-}
+#define INLINE_COPY_FROM_USER
+#define INLINE_COPY_TO_USER
static inline unsigned long
-__generic_clear_user_nocheck(void __user *to, unsigned long n)
+__clear_user(void __user *to, unsigned long n)
{
return __do_clear_user(to, n);
}
-/* without checking */
-
-#define __copy_to_user(to, from, n) \
- __generic_copy_to_user_nocheck((to), (from), (n))
-#define __copy_from_user(to, from, n) \
- __generic_copy_from_user_nocheck((to), (from), (n))
-#define __copy_to_user_inatomic __copy_to_user
-#define __copy_from_user_inatomic __copy_from_user
-#define __clear_user(to, n) __generic_clear_user_nocheck((to), (n))
-
#define strlen_user(str) strnlen_user((str), 0x7ffffffe)
#endif /* _CRIS_UACCESS_H */