[PATCH] fix sparse warnings from {asm,net}/checksum.h
[linux-3.10.git] / include / asm-x86_64 / uaccess.h
index e856570..8079e29 100644 (file)
@@ -6,7 +6,6 @@
  */
 #include <linux/compiler.h>
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/prefetch.h>
 #include <asm/page.h>
 
  * Uhhuh, this needs 65-bit arithmetic. We have a carry..
  */
 #define __range_not_ok(addr,size) ({ \
-       unsigned long flag,sum; \
+       unsigned long flag,roksum; \
        __chk_user_ptr(addr); \
        asm("# range_ok\n\r" \
                "addq %3,%1 ; sbbq %0,%0 ; cmpq %1,%4 ; sbbq $0,%0"  \
-               :"=&r" (flag), "=r" (sum) \
+               :"=&r" (flag), "=r" (roksum) \
                :"1" (addr),"g" ((long)(size)),"g" (current_thread_info()->addr_limit.seg)); \
        flag; })
 
@@ -158,7 +157,7 @@ do {                                                                        \
          case 1: __put_user_asm(x,ptr,retval,"b","b","iq",-EFAULT); break;\
          case 2: __put_user_asm(x,ptr,retval,"w","w","ir",-EFAULT); break;\
          case 4: __put_user_asm(x,ptr,retval,"l","k","ir",-EFAULT); break;\
-         case 8: __put_user_asm(x,ptr,retval,"q","","ir",-EFAULT); break;\
+         case 8: __put_user_asm(x,ptr,retval,"q","","Zr",-EFAULT); break;\
          default: __put_user_bad();                                    \
        }                                                               \
 } while (0)
@@ -361,6 +360,11 @@ __must_check unsigned long clear_user(void __user *mem, unsigned long len);
 __must_check unsigned long __clear_user(void __user *mem, unsigned long len);
 
 __must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size);
-#define __copy_to_user_inatomic copy_user_generic
+
+static __must_check __always_inline int
+__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
+{
+       return copy_user_generic((__force void *)dst, src, size);
+}
 
 #endif /* __X86_64_UACCESS_H */