diff options
Diffstat (limited to 'arch/mips/include/asm/uaccess.h')
| -rw-r--r-- | arch/mips/include/asm/uaccess.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h index 06629011a434..d43c1dc6ef15 100644 --- a/arch/mips/include/asm/uaccess.h +++ b/arch/mips/include/asm/uaccess.h | |||
| @@ -109,9 +109,6 @@ static inline bool eva_kernel_access(void) | |||
| 109 | 109 | ||
| 110 | /* | 110 | /* |
| 111 | * access_ok: - Checks if a user space pointer is valid | 111 | * access_ok: - Checks if a user space pointer is valid |
| 112 | * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that | ||
| 113 | * %VERIFY_WRITE is a superset of %VERIFY_READ - if it is safe | ||
| 114 | * to write to a block, it is always safe to read from it. | ||
| 115 | * @addr: User space pointer to start of block to check | 112 | * @addr: User space pointer to start of block to check |
| 116 | * @size: Size of block to check | 113 | * @size: Size of block to check |
| 117 | * | 114 | * |
| @@ -134,7 +131,7 @@ static inline int __access_ok(const void __user *p, unsigned long size) | |||
| 134 | return (get_fs().seg & (addr | (addr + size) | __ua_size(size))) == 0; | 131 | return (get_fs().seg & (addr | (addr + size) | __ua_size(size))) == 0; |
| 135 | } | 132 | } |
| 136 | 133 | ||
| 137 | #define access_ok(type, addr, size) \ | 134 | #define access_ok(addr, size) \ |
| 138 | likely(__access_ok((addr), (size))) | 135 | likely(__access_ok((addr), (size))) |
| 139 | 136 | ||
| 140 | /* | 137 | /* |
| @@ -304,7 +301,7 @@ do { \ | |||
| 304 | const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ | 301 | const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ |
| 305 | \ | 302 | \ |
| 306 | might_fault(); \ | 303 | might_fault(); \ |
| 307 | if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) { \ | 304 | if (likely(access_ok( __gu_ptr, size))) { \ |
| 308 | if (eva_kernel_access()) \ | 305 | if (eva_kernel_access()) \ |
| 309 | __get_kernel_common((x), size, __gu_ptr); \ | 306 | __get_kernel_common((x), size, __gu_ptr); \ |
| 310 | else \ | 307 | else \ |
| @@ -446,7 +443,7 @@ do { \ | |||
| 446 | int __pu_err = -EFAULT; \ | 443 | int __pu_err = -EFAULT; \ |
| 447 | \ | 444 | \ |
| 448 | might_fault(); \ | 445 | might_fault(); \ |
| 449 | if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ | 446 | if (likely(access_ok( __pu_addr, size))) { \ |
| 450 | if (eva_kernel_access()) \ | 447 | if (eva_kernel_access()) \ |
| 451 | __put_kernel_common(__pu_addr, size); \ | 448 | __put_kernel_common(__pu_addr, size); \ |
| 452 | else \ | 449 | else \ |
| @@ -691,8 +688,7 @@ __clear_user(void __user *addr, __kernel_size_t size) | |||
| 691 | ({ \ | 688 | ({ \ |
| 692 | void __user * __cl_addr = (addr); \ | 689 | void __user * __cl_addr = (addr); \ |
| 693 | unsigned long __cl_size = (n); \ | 690 | unsigned long __cl_size = (n); \ |
| 694 | if (__cl_size && access_ok(VERIFY_WRITE, \ | 691 | if (__cl_size && access_ok(__cl_addr, __cl_size)) \ |
| 695 | __cl_addr, __cl_size)) \ | ||
| 696 | __cl_size = __clear_user(__cl_addr, __cl_size); \ | 692 | __cl_size = __clear_user(__cl_addr, __cl_size); \ |
| 697 | __cl_size; \ | 693 | __cl_size; \ |
| 698 | }) | 694 | }) |
