Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / asm-um / uaccess.h
index 801710d..16c734a 100644 (file)
 
 #define __get_user(x, ptr) \
 ({ \
-        const __typeof__(ptr) __private_ptr = ptr; \
-        __typeof__(*(__private_ptr)) __private_val; \
-        int __private_ret = -EFAULT; \
-        (x) = 0; \
-       if (__copy_from_user(&__private_val, (__private_ptr), \
-           sizeof(*(__private_ptr))) == 0) {\
-               (x) = (__typeof__(*(__private_ptr))) __private_val; \
-               __private_ret = 0; \
-       } \
-        __private_ret; \
+       const __typeof__(*(ptr)) __user *__private_ptr = (ptr); \
+       __typeof__(x) __private_val;                    \
+       int __private_ret = -EFAULT;                    \
+       (x) = (__typeof__(*(__private_ptr)))0;                          \
+       if (__copy_from_user((__force void *)&__private_val, (__private_ptr),\
+                            sizeof(*(__private_ptr))) == 0) {          \
+               (x) = (__typeof__(*(__private_ptr))) __private_val;     \
+               __private_ret = 0;                                      \
+       }                                                               \
+       __private_ret;                                                  \
 }) 
 
 #define get_user(x, ptr) \
 ({ \
         const __typeof__((*(ptr))) __user *private_ptr = (ptr); \
         (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \
-        __get_user(x, private_ptr) : ((x) = 0, -EFAULT)); \
+        __get_user(x, private_ptr) : ((x) = (__typeof__(*ptr))0, -EFAULT)); \
 })
 
 #define __put_user(x, ptr) \
 ({ \
-        __typeof__(ptr) __private_ptr = ptr; \
+        __typeof__(*(ptr)) __user *__private_ptr = ptr; \
         __typeof__(*(__private_ptr)) __private_val; \
         int __private_ret = -EFAULT; \
         __private_val = (__typeof__(*(__private_ptr))) (x); \
@@ -89,14 +89,3 @@ struct exception_table_entry
 };
 
 #endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */