ia64: get rid of 'segment' argument of __do_{get,put}_user()
it's only evaluated if the first argument is not 0, and in those cases it's always equal to get_fs() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1bd5986bbc
commit
11836ecee9
|
@ -180,13 +180,13 @@ extern void __get_user_unknown (void);
|
|||
* could clobber r8 and r9 (among others). Thus, be careful not to evaluate it while
|
||||
* using r8/r9.
|
||||
*/
|
||||
#define __do_get_user(check, x, ptr, size, segment) \
|
||||
#define __do_get_user(check, x, ptr, size) \
|
||||
({ \
|
||||
const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \
|
||||
__typeof__ (size) __gu_size = (size); \
|
||||
long __gu_err = -EFAULT; \
|
||||
unsigned long __gu_val = 0; \
|
||||
if (!check || __access_ok(__gu_ptr, size, segment)) \
|
||||
if (!check || __access_ok(__gu_ptr, size, get_fs())) \
|
||||
switch (__gu_size) { \
|
||||
case 1: __get_user_size(__gu_val, __gu_ptr, 1, __gu_err); break; \
|
||||
case 2: __get_user_size(__gu_val, __gu_ptr, 2, __gu_err); break; \
|
||||
|
@ -198,8 +198,8 @@ extern void __get_user_unknown (void);
|
|||
__gu_err; \
|
||||
})
|
||||
|
||||
#define __get_user_nocheck(x, ptr, size) __do_get_user(0, x, ptr, size, KERNEL_DS)
|
||||
#define __get_user_check(x, ptr, size) __do_get_user(1, x, ptr, size, get_fs())
|
||||
#define __get_user_nocheck(x, ptr, size) __do_get_user(0, x, ptr, size)
|
||||
#define __get_user_check(x, ptr, size) __do_get_user(1, x, ptr, size)
|
||||
|
||||
extern void __put_user_unknown (void);
|
||||
|
||||
|
@ -207,14 +207,14 @@ extern void __put_user_unknown (void);
|
|||
* Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which
|
||||
* could clobber r8 (among others). Thus, be careful not to evaluate them while using r8.
|
||||
*/
|
||||
#define __do_put_user(check, x, ptr, size, segment) \
|
||||
#define __do_put_user(check, x, ptr, size) \
|
||||
({ \
|
||||
__typeof__ (x) __pu_x = (x); \
|
||||
__typeof__ (*(ptr)) __user *__pu_ptr = (ptr); \
|
||||
__typeof__ (size) __pu_size = (size); \
|
||||
long __pu_err = -EFAULT; \
|
||||
\
|
||||
if (!check || __access_ok(__pu_ptr, __pu_size, segment)) \
|
||||
if (!check || __access_ok(__pu_ptr, __pu_size, get_fs())) \
|
||||
switch (__pu_size) { \
|
||||
case 1: __put_user_size(__pu_x, __pu_ptr, 1, __pu_err); break; \
|
||||
case 2: __put_user_size(__pu_x, __pu_ptr, 2, __pu_err); break; \
|
||||
|
@ -225,8 +225,8 @@ extern void __put_user_unknown (void);
|
|||
__pu_err; \
|
||||
})
|
||||
|
||||
#define __put_user_nocheck(x, ptr, size) __do_put_user(0, x, ptr, size, KERNEL_DS)
|
||||
#define __put_user_check(x, ptr, size) __do_put_user(1, x, ptr, size, get_fs())
|
||||
#define __put_user_nocheck(x, ptr, size) __do_put_user(0, x, ptr, size)
|
||||
#define __put_user_check(x, ptr, size) __do_put_user(1, x, ptr, size)
|
||||
|
||||
/*
|
||||
* Complex access routines
|
||||
|
|
Loading…
Reference in New Issue