aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/m32r/lib/usercopy.c16
-rw-r--r--include/asm-m32r/uaccess.h10
2 files changed, 14 insertions, 12 deletions
diff --git a/arch/m32r/lib/usercopy.c b/arch/m32r/lib/usercopy.c
index 6c6855f1aa05..ce16bbe26a52 100644
--- a/arch/m32r/lib/usercopy.c
+++ b/arch/m32r/lib/usercopy.c
@@ -13,7 +13,7 @@
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14 14
15unsigned long 15unsigned long
16__generic_copy_to_user(void *to, const void *from, unsigned long n) 16__generic_copy_to_user(void __user *to, const void *from, unsigned long n)
17{ 17{
18 prefetch(from); 18 prefetch(from);
19 if (access_ok(VERIFY_WRITE, to, n)) 19 if (access_ok(VERIFY_WRITE, to, n))
@@ -22,7 +22,7 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n)
22} 22}
23 23
24unsigned long 24unsigned long
25__generic_copy_from_user(void *to, const void *from, unsigned long n) 25__generic_copy_from_user(void *to, const void __user *from, unsigned long n)
26{ 26{
27 prefetchw(to); 27 prefetchw(to);
28 if (access_ok(VERIFY_READ, from, n)) 28 if (access_ok(VERIFY_READ, from, n))
@@ -111,7 +111,7 @@ do { \
111#endif /* CONFIG_ISA_DUAL_ISSUE */ 111#endif /* CONFIG_ISA_DUAL_ISSUE */
112 112
113long 113long
114__strncpy_from_user(char *dst, const char *src, long count) 114__strncpy_from_user(char *dst, const char __user *src, long count)
115{ 115{
116 long res; 116 long res;
117 __do_strncpy_from_user(dst, src, count, res); 117 __do_strncpy_from_user(dst, src, count, res);
@@ -119,7 +119,7 @@ __strncpy_from_user(char *dst, const char *src, long count)
119} 119}
120 120
121long 121long
122strncpy_from_user(char *dst, const char *src, long count) 122strncpy_from_user(char *dst, const char __user *src, long count)
123{ 123{
124 long res = -EFAULT; 124 long res = -EFAULT;
125 if (access_ok(VERIFY_READ, src, 1)) 125 if (access_ok(VERIFY_READ, src, 1))
@@ -222,7 +222,7 @@ do { \
222#endif /* not CONFIG_ISA_DUAL_ISSUE */ 222#endif /* not CONFIG_ISA_DUAL_ISSUE */
223 223
224unsigned long 224unsigned long
225clear_user(void *to, unsigned long n) 225clear_user(void __user *to, unsigned long n)
226{ 226{
227 if (access_ok(VERIFY_WRITE, to, n)) 227 if (access_ok(VERIFY_WRITE, to, n))
228 __do_clear_user(to, n); 228 __do_clear_user(to, n);
@@ -230,7 +230,7 @@ clear_user(void *to, unsigned long n)
230} 230}
231 231
232unsigned long 232unsigned long
233__clear_user(void *to, unsigned long n) 233__clear_user(void __user *to, unsigned long n)
234{ 234{
235 __do_clear_user(to, n); 235 __do_clear_user(to, n);
236 return n; 236 return n;
@@ -244,7 +244,7 @@ __clear_user(void *to, unsigned long n)
244 244
245#ifdef CONFIG_ISA_DUAL_ISSUE 245#ifdef CONFIG_ISA_DUAL_ISSUE
246 246
247long strnlen_user(const char *s, long n) 247long strnlen_user(const char __user *s, long n)
248{ 248{
249 unsigned long mask = -__addr_ok(s); 249 unsigned long mask = -__addr_ok(s);
250 unsigned long res; 250 unsigned long res;
@@ -313,7 +313,7 @@ long strnlen_user(const char *s, long n)
313 313
314#else /* not CONFIG_ISA_DUAL_ISSUE */ 314#else /* not CONFIG_ISA_DUAL_ISSUE */
315 315
316long strnlen_user(const char *s, long n) 316long strnlen_user(const char __user *s, long n)
317{ 317{
318 unsigned long mask = -__addr_ok(s); 318 unsigned long mask = -__addr_ok(s);
319 unsigned long res; 319 unsigned long res;
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h
index 93d863c455a1..0da7c47d2f01 100644
--- a/include/asm-m32r/uaccess.h
+++ b/include/asm-m32r/uaccess.h
@@ -208,7 +208,8 @@ extern void __get_user_4(void);
208 * On error, the variable @x is set to zero. 208 * On error, the variable @x is set to zero.
209 */ 209 */
210#define get_user(x,ptr) \ 210#define get_user(x,ptr) \
211({ int __ret_gu,__val_gu; \ 211({ int __ret_gu; \
212 unsigned long __val_gu; \
212 __chk_user_ptr(ptr); \ 213 __chk_user_ptr(ptr); \
213 switch(sizeof (*(ptr))) { \ 214 switch(sizeof (*(ptr))) { \
214 case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \ 215 case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \
@@ -403,7 +404,8 @@ struct __large_struct { unsigned long buf[100]; };
403 404
404#define __get_user_nocheck(x,ptr,size) \ 405#define __get_user_nocheck(x,ptr,size) \
405({ \ 406({ \
406 long __gu_err, __gu_val; \ 407 long __gu_err; \
408 unsigned long __gu_val; \
407 __get_user_size(__gu_val,(ptr),(size),__gu_err); \ 409 __get_user_size(__gu_val,(ptr),(size),__gu_err); \
408 (x) = (__typeof__(*(ptr)))__gu_val; \ 410 (x) = (__typeof__(*(ptr)))__gu_val; \
409 __gu_err; \ 411 __gu_err; \
@@ -594,8 +596,8 @@ static inline unsigned long __generic_copy_to_user_nocheck(void __user *to,
594 return n; 596 return n;
595} 597}
596 598
597unsigned long __generic_copy_to_user(void *, const void *, unsigned long); 599unsigned long __generic_copy_to_user(void __user *, const void *, unsigned long);
598unsigned long __generic_copy_from_user(void *, const void *, unsigned long); 600unsigned long __generic_copy_from_user(void *, const void __user *, unsigned long);
599 601
600/** 602/**
601 * __copy_to_user: - Copy a block of data into user space, with less checking. 603 * __copy_to_user: - Copy a block of data into user space, with less checking.