diff options
Diffstat (limited to 'arch/blackfin/include/asm/uaccess.h')
-rw-r--r-- | arch/blackfin/include/asm/uaccess.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h index 57701c3b8a59..90612a7f2cf3 100644 --- a/arch/blackfin/include/asm/uaccess.h +++ b/arch/blackfin/include/asm/uaccess.h | |||
@@ -27,7 +27,7 @@ static inline void set_fs(mm_segment_t fs) | |||
27 | current_thread_info()->addr_limit = fs; | 27 | current_thread_info()->addr_limit = fs; |
28 | } | 28 | } |
29 | 29 | ||
30 | #define segment_eq(a,b) ((a) == (b)) | 30 | #define segment_eq(a, b) ((a) == (b)) |
31 | 31 | ||
32 | #define VERIFY_READ 0 | 32 | #define VERIFY_READ 0 |
33 | #define VERIFY_WRITE 1 | 33 | #define VERIFY_WRITE 1 |
@@ -68,11 +68,11 @@ struct exception_table_entry { | |||
68 | * use the right size if we just have the right pointer type. | 68 | * use the right size if we just have the right pointer type. |
69 | */ | 69 | */ |
70 | 70 | ||
71 | #define put_user(x,p) \ | 71 | #define put_user(x, p) \ |
72 | ({ \ | 72 | ({ \ |
73 | int _err = 0; \ | 73 | int _err = 0; \ |
74 | typeof(*(p)) _x = (x); \ | 74 | typeof(*(p)) _x = (x); \ |
75 | typeof(*(p)) __user *_p = (p); \ | 75 | typeof(*(p)) __user *_p = (p); \ |
76 | if (!access_ok(VERIFY_WRITE, _p, sizeof(*(_p)))) {\ | 76 | if (!access_ok(VERIFY_WRITE, _p, sizeof(*(_p)))) {\ |
77 | _err = -EFAULT; \ | 77 | _err = -EFAULT; \ |
78 | } \ | 78 | } \ |
@@ -89,10 +89,10 @@ struct exception_table_entry { | |||
89 | break; \ | 89 | break; \ |
90 | case 8: { \ | 90 | case 8: { \ |
91 | long _xl, _xh; \ | 91 | long _xl, _xh; \ |
92 | _xl = ((long *)&_x)[0]; \ | 92 | _xl = ((__force long *)&_x)[0]; \ |
93 | _xh = ((long *)&_x)[1]; \ | 93 | _xh = ((__force long *)&_x)[1]; \ |
94 | __put_user_asm(_xl, ((long __user *)_p)+0, ); \ | 94 | __put_user_asm(_xl, ((__force long __user *)_p)+0, );\ |
95 | __put_user_asm(_xh, ((long __user *)_p)+1, ); \ | 95 | __put_user_asm(_xh, ((__force long __user *)_p)+1, );\ |
96 | } break; \ | 96 | } break; \ |
97 | default: \ | 97 | default: \ |
98 | _err = __put_user_bad(); \ | 98 | _err = __put_user_bad(); \ |
@@ -102,7 +102,7 @@ struct exception_table_entry { | |||
102 | _err; \ | 102 | _err; \ |
103 | }) | 103 | }) |
104 | 104 | ||
105 | #define __put_user(x,p) put_user(x,p) | 105 | #define __put_user(x, p) put_user(x, p) |
106 | static inline int bad_user_access_length(void) | 106 | static inline int bad_user_access_length(void) |
107 | { | 107 | { |
108 | panic("bad_user_access_length"); | 108 | panic("bad_user_access_length"); |
@@ -121,10 +121,10 @@ static inline int bad_user_access_length(void) | |||
121 | 121 | ||
122 | #define __ptr(x) ((unsigned long __force *)(x)) | 122 | #define __ptr(x) ((unsigned long __force *)(x)) |
123 | 123 | ||
124 | #define __put_user_asm(x,p,bhw) \ | 124 | #define __put_user_asm(x, p, bhw) \ |
125 | __asm__ (#bhw"[%1] = %0;\n\t" \ | 125 | __asm__ (#bhw"[%1] = %0;\n\t" \ |
126 | : /* no outputs */ \ | 126 | : /* no outputs */ \ |
127 | :"d" (x),"a" (__ptr(p)) : "memory") | 127 | :"d" (x), "a" (__ptr(p)) : "memory") |
128 | 128 | ||
129 | #define get_user(x, ptr) \ | 129 | #define get_user(x, ptr) \ |
130 | ({ \ | 130 | ({ \ |
@@ -136,10 +136,10 @@ static inline int bad_user_access_length(void) | |||
136 | BUILD_BUG_ON(ptr_size >= 8); \ | 136 | BUILD_BUG_ON(ptr_size >= 8); \ |
137 | switch (ptr_size) { \ | 137 | switch (ptr_size) { \ |
138 | case 1: \ | 138 | case 1: \ |
139 | __get_user_asm(_val, _p, B,(Z)); \ | 139 | __get_user_asm(_val, _p, B, (Z)); \ |
140 | break; \ | 140 | break; \ |
141 | case 2: \ | 141 | case 2: \ |
142 | __get_user_asm(_val, _p, W,(Z)); \ | 142 | __get_user_asm(_val, _p, W, (Z)); \ |
143 | break; \ | 143 | break; \ |
144 | case 4: \ | 144 | case 4: \ |
145 | __get_user_asm(_val, _p, , ); \ | 145 | __get_user_asm(_val, _p, , ); \ |
@@ -147,11 +147,11 @@ static inline int bad_user_access_length(void) | |||
147 | } \ | 147 | } \ |
148 | } else \ | 148 | } else \ |
149 | _err = -EFAULT; \ | 149 | _err = -EFAULT; \ |
150 | x = (typeof(*(ptr)))_val; \ | 150 | x = (__force typeof(*(ptr)))_val; \ |
151 | _err; \ | 151 | _err; \ |
152 | }) | 152 | }) |
153 | 153 | ||
154 | #define __get_user(x,p) get_user(x,p) | 154 | #define __get_user(x, p) get_user(x, p) |
155 | 155 | ||
156 | #define __get_user_bad() (bad_user_access_length(), (-EFAULT)) | 156 | #define __get_user_bad() (bad_user_access_length(), (-EFAULT)) |
157 | 157 | ||
@@ -168,10 +168,10 @@ static inline int bad_user_access_length(void) | |||
168 | #define __copy_to_user_inatomic __copy_to_user | 168 | #define __copy_to_user_inatomic __copy_to_user |
169 | #define __copy_from_user_inatomic __copy_from_user | 169 | #define __copy_from_user_inatomic __copy_from_user |
170 | 170 | ||
171 | #define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n))\ | 171 | #define copy_to_user_ret(to, from, n, retval) ({ if (copy_to_user(to, from, n))\ |
172 | return retval; }) | 172 | return retval; }) |
173 | 173 | ||
174 | #define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n))\ | 174 | #define copy_from_user_ret(to, from, n, retval) ({ if (copy_from_user(to, from, n))\ |
175 | return retval; }) | 175 | return retval; }) |
176 | 176 | ||
177 | static inline unsigned long __must_check | 177 | static inline unsigned long __must_check |