Merge branch 'regmap-4.21' into regmap-5.0
[linux-2.6-block.git] / arch / powerpc / include / asm / uaccess.h
index ebc0b916dcf9047b5ec00d597a8d01137aef93de..e3a731793ea23f24bbe28981f7191ed48a14f715 100644 (file)
@@ -62,8 +62,8 @@ static inline int __access_ok(unsigned long addr, unsigned long size,
 
 #endif
 
-#define access_ok(type, addr, size)            \
-       (__chk_user_ptr(addr), (void)(type),            \
+#define access_ok(addr, size)          \
+       (__chk_user_ptr(addr),          \
         __access_ok((__force unsigned long)(addr), (size), get_fs()))
 
 /*
@@ -166,7 +166,7 @@ do {                                                                \
        long __pu_err = -EFAULT;                                        \
        __typeof__(*(ptr)) __user *__pu_addr = (ptr);                   \
        might_fault();                                                  \
-       if (access_ok(VERIFY_WRITE, __pu_addr, size))                   \
+       if (access_ok(__pu_addr, size))                 \
                __put_user_size((x), __pu_addr, (size), __pu_err);      \
        __pu_err;                                                       \
 })
@@ -276,7 +276,7 @@ do {                                                                \
        __long_type(*(ptr)) __gu_val = 0;                               \
        __typeof__(*(ptr)) __user *__gu_addr = (ptr);           \
        might_fault();                                                  \
-       if (access_ok(VERIFY_READ, __gu_addr, (size))) {                \
+       if (access_ok(__gu_addr, (size))) {             \
                barrier_nospec();                                       \
                __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
        }                                                               \
@@ -374,7 +374,7 @@ extern unsigned long __clear_user(void __user *addr, unsigned long size);
 static inline unsigned long clear_user(void __user *addr, unsigned long size)
 {
        might_fault();
-       if (likely(access_ok(VERIFY_WRITE, addr, size)))
+       if (likely(access_ok(addr, size)))
                return __clear_user(addr, size);
        return size;
 }