diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2013-02-21 10:57:42 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-02-28 03:37:09 -0500 |
commit | d12a2970385cfe0c1b0439f53c3ed1055d4dee3e (patch) | |
tree | 2e63d3933409588c922af66d76c89eb1b104415d /arch/s390/include/asm/uaccess.h | |
parent | f45655f6a65538237359abce55edab9cfcc6d82f (diff) |
s390/uaccess: remove pointless access_ok() checks
access_ok() always returns 'true' on s390. Therefore all calls
are quite pointless and can be removed.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/uaccess.h')
-rw-r--r-- | arch/s390/include/asm/uaccess.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index 34268df959a3..9c33ed4e666f 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h | |||
@@ -252,9 +252,7 @@ static inline unsigned long __must_check | |||
252 | copy_to_user(void __user *to, const void *from, unsigned long n) | 252 | copy_to_user(void __user *to, const void *from, unsigned long n) |
253 | { | 253 | { |
254 | might_fault(); | 254 | might_fault(); |
255 | if (access_ok(VERIFY_WRITE, to, n)) | 255 | return __copy_to_user(to, from, n); |
256 | n = __copy_to_user(to, from, n); | ||
257 | return n; | ||
258 | } | 256 | } |
259 | 257 | ||
260 | /** | 258 | /** |
@@ -315,11 +313,7 @@ copy_from_user(void *to, const void __user *from, unsigned long n) | |||
315 | copy_from_user_overflow(); | 313 | copy_from_user_overflow(); |
316 | return n; | 314 | return n; |
317 | } | 315 | } |
318 | if (access_ok(VERIFY_READ, from, n)) | 316 | return __copy_from_user(to, from, n); |
319 | n = __copy_from_user(to, from, n); | ||
320 | else | ||
321 | memset(to, 0, n); | ||
322 | return n; | ||
323 | } | 317 | } |
324 | 318 | ||
325 | static inline unsigned long __must_check | 319 | static inline unsigned long __must_check |
@@ -332,9 +326,7 @@ static inline unsigned long __must_check | |||
332 | copy_in_user(void __user *to, const void __user *from, unsigned long n) | 326 | copy_in_user(void __user *to, const void __user *from, unsigned long n) |
333 | { | 327 | { |
334 | might_fault(); | 328 | might_fault(); |
335 | if (__access_ok(from,n) && __access_ok(to,n)) | 329 | return __copy_in_user(to, from, n); |
336 | n = __copy_in_user(to, from, n); | ||
337 | return n; | ||
338 | } | 330 | } |
339 | 331 | ||
340 | /* | 332 | /* |
@@ -343,11 +335,8 @@ copy_in_user(void __user *to, const void __user *from, unsigned long n) | |||
343 | static inline long __must_check | 335 | static inline long __must_check |
344 | strncpy_from_user(char *dst, const char __user *src, long count) | 336 | strncpy_from_user(char *dst, const char __user *src, long count) |
345 | { | 337 | { |
346 | long res = -EFAULT; | ||
347 | might_fault(); | 338 | might_fault(); |
348 | if (access_ok(VERIFY_READ, src, 1)) | 339 | return uaccess.strncpy_from_user(count, src, dst); |
349 | res = uaccess.strncpy_from_user(count, src, dst); | ||
350 | return res; | ||
351 | } | 340 | } |
352 | 341 | ||
353 | static inline unsigned long | 342 | static inline unsigned long |
@@ -387,9 +376,7 @@ static inline unsigned long __must_check | |||
387 | clear_user(void __user *to, unsigned long n) | 376 | clear_user(void __user *to, unsigned long n) |
388 | { | 377 | { |
389 | might_fault(); | 378 | might_fault(); |
390 | if (access_ok(VERIFY_WRITE, to, n)) | 379 | return uaccess.clear_user(n, to); |
391 | n = uaccess.clear_user(n, to); | ||
392 | return n; | ||
393 | } | 380 | } |
394 | 381 | ||
395 | extern int copy_to_user_real(void __user *dest, void *src, size_t count); | 382 | extern int copy_to_user_real(void __user *dest, void *src, size_t count); |