diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-s390/uaccess.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index 38a5cf8ab9e3..10a619da4761 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h | |||
@@ -200,21 +200,37 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
200 | 200 | ||
201 | #define __get_user(x, ptr) \ | 201 | #define __get_user(x, ptr) \ |
202 | ({ \ | 202 | ({ \ |
203 | __typeof__(*(ptr)) __x; \ | ||
204 | int __gu_err; \ | 203 | int __gu_err; \ |
205 | __chk_user_ptr(ptr); \ | 204 | __chk_user_ptr(ptr); \ |
206 | switch (sizeof(*(ptr))) { \ | 205 | switch (sizeof(*(ptr))) { \ |
207 | case 1: \ | 206 | case 1: { \ |
208 | case 2: \ | 207 | unsigned char __x; \ |
209 | case 4: \ | 208 | __get_user_asm(__x, ptr, __gu_err); \ |
210 | case 8: \ | 209 | (x) = (__typeof__(*(ptr))) __x; \ |
210 | break; \ | ||
211 | }; \ | ||
212 | case 2: { \ | ||
213 | unsigned short __x; \ | ||
214 | __get_user_asm(__x, ptr, __gu_err); \ | ||
215 | (x) = (__typeof__(*(ptr))) __x; \ | ||
216 | break; \ | ||
217 | }; \ | ||
218 | case 4: { \ | ||
219 | unsigned int __x; \ | ||
220 | __get_user_asm(__x, ptr, __gu_err); \ | ||
221 | (x) = (__typeof__(*(ptr))) __x; \ | ||
222 | break; \ | ||
223 | }; \ | ||
224 | case 8: { \ | ||
225 | unsigned long long __x; \ | ||
211 | __get_user_asm(__x, ptr, __gu_err); \ | 226 | __get_user_asm(__x, ptr, __gu_err); \ |
227 | (x) = (__typeof__(*(ptr))) __x; \ | ||
212 | break; \ | 228 | break; \ |
229 | }; \ | ||
213 | default: \ | 230 | default: \ |
214 | __get_user_bad(); \ | 231 | __get_user_bad(); \ |
215 | break; \ | 232 | break; \ |
216 | } \ | 233 | } \ |
217 | (x) = __x; \ | ||
218 | __gu_err; \ | 234 | __gu_err; \ |
219 | }) | 235 | }) |
220 | 236 | ||