Commit c9df6025 authored by Al Viro's avatar Al Viro

alpha: kill the 'segment' argument of __access_ok()

always equal to get_fs().
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent f14d6b4f
......@@ -32,13 +32,13 @@
* - AND "addr+size" doesn't have any high-bits set
* - OR we are in kernel mode.
*/
#define __access_ok(addr, size, segment) \
(((segment).seg & (addr | size | (addr+size))) == 0)
#define __access_ok(addr, size) \
((get_fs().seg & (addr | size | (addr+size))) == 0)
#define access_ok(type, addr, size) \
({ \
__chk_user_ptr(addr); \
__access_ok(((unsigned long)(addr)), (size), get_fs()); \
__access_ok(((unsigned long)(addr)), (size)); \
})
/*
......@@ -98,7 +98,7 @@ extern void __get_user_unknown(void);
long __gu_err = -EFAULT; \
unsigned long __gu_val = 0; \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
if (__access_ok((unsigned long)__gu_addr, size, get_fs())) { \
if (__access_ok((unsigned long)__gu_addr, size)) { \
__gu_err = 0; \
switch (size) { \
case 1: __get_user_8(__gu_addr); break; \
......@@ -212,7 +212,7 @@ extern void __put_user_unknown(void);
({ \
long __pu_err = -EFAULT; \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
if (__access_ok((unsigned long)__pu_addr, size, get_fs())) { \
if (__access_ok((unsigned long)__pu_addr, size)) { \
__pu_err = 0; \
switch (size) { \
case 1: __put_user_8(x, __pu_addr); break; \
......@@ -353,7 +353,7 @@ extern long __copy_user(void *to, const void *from, long len);
extern inline long
copy_to_user(void __user *to, const void *from, long n)
{
if (likely(__access_ok((unsigned long)to, n, get_fs())))
if (likely(__access_ok((unsigned long)to, n)))
n = __copy_user((__force void *)to, from, n);
return n;
}
......@@ -362,7 +362,7 @@ extern inline long
copy_from_user(void *to, const void __user *from, long n)
{
long res = n;
if (likely(__access_ok((unsigned long)from, n, get_fs())))
if (likely(__access_ok((unsigned long)from, n)))
res = __copy_from_user_inatomic(to, from, n);
if (unlikely(res))
memset(to + (n - res), 0, res);
......@@ -374,7 +374,7 @@ extern long __clear_user(void __user *to, long len);
extern inline long
clear_user(void __user *to, long len)
{
if (__access_ok((unsigned long)to, len, get_fs()))
if (__access_ok((unsigned long)to, len))
len = __clear_user(to, len);
return len;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment