diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-03-21 12:10:12 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-11 09:30:55 -0400 |
commit | d491afb8654e84f972ed00cb0e087ad2fae5a1ac (patch) | |
tree | 5bf5fa6d825da863a00715a35a2e92b49a08660a /arch/microblaze | |
parent | 730132e7e52210cbbfa95af67f5e23a63199c13d (diff) |
microblaze: switch to RAW_COPY_USER
[kudos to Piotr Sroka for spotting a braino in the previous variant]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/Kconfig | 1 | ||||
-rw-r--r-- | arch/microblaze/include/asm/uaccess.h | 36 |
2 files changed, 9 insertions, 28 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 85885a501dce..1aff3658a104 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig | |||
@@ -34,6 +34,7 @@ config MICROBLAZE | |||
34 | select TRACING_SUPPORT | 34 | select TRACING_SUPPORT |
35 | select VIRT_TO_BUS | 35 | select VIRT_TO_BUS |
36 | select CPU_NO_EFFICIENT_FFS | 36 | select CPU_NO_EFFICIENT_FFS |
37 | select ARCH_HAS_RAW_COPY_USER | ||
37 | 38 | ||
38 | config SWAP | 39 | config SWAP |
39 | def_bool n | 40 | def_bool n |
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index 2c39375ac871..38f2c9ccef10 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h | |||
@@ -336,39 +336,19 @@ extern long __user_bad(void); | |||
336 | __gu_err; \ | 336 | __gu_err; \ |
337 | }) | 337 | }) |
338 | 338 | ||
339 | 339 | static inline unsigned long | |
340 | /* copy_to_from_user */ | 340 | raw_copy_from_user(void *to, const void __user *from, unsigned long n) |
341 | #define __copy_from_user(to, from, n) \ | ||
342 | __copy_tofrom_user((__force void __user *)(to), \ | ||
343 | (void __user *)(from), (n)) | ||
344 | #define __copy_from_user_inatomic(to, from, n) \ | ||
345 | __copy_from_user((to), (from), (n)) | ||
346 | |||
347 | static inline long copy_from_user(void *to, | ||
348 | const void __user *from, unsigned long n) | ||
349 | { | 341 | { |
350 | unsigned long res = n; | 342 | return __copy_tofrom_user((__force void __user *)to, from, n); |
351 | might_fault(); | ||
352 | if (likely(access_ok(VERIFY_READ, from, n))) | ||
353 | res = __copy_from_user(to, from, n); | ||
354 | if (unlikely(res)) | ||
355 | memset(to + (n - res), 0, res); | ||
356 | return res; | ||
357 | } | 343 | } |
358 | 344 | ||
359 | #define __copy_to_user(to, from, n) \ | 345 | static inline unsigned long |
360 | __copy_tofrom_user((void __user *)(to), \ | 346 | raw_copy_to_user(void __user *to, const void *from, unsigned long n) |
361 | (__force const void __user *)(from), (n)) | ||
362 | #define __copy_to_user_inatomic(to, from, n) __copy_to_user((to), (from), (n)) | ||
363 | |||
364 | static inline long copy_to_user(void __user *to, | ||
365 | const void *from, unsigned long n) | ||
366 | { | 347 | { |
367 | might_fault(); | 348 | return __copy_tofrom_user(to, (__force const void __user *)from, n); |
368 | if (access_ok(VERIFY_WRITE, to, n)) | ||
369 | return __copy_to_user(to, from, n); | ||
370 | return n; | ||
371 | } | 349 | } |
350 | #define INLINE_COPY_FROM_USER | ||
351 | #define INLINE_COPY_TO_USER | ||
372 | 352 | ||
373 | /* | 353 | /* |
374 | * Copy a null terminated string from userspace. | 354 | * Copy a null terminated string from userspace. |