Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
[powerpc.git] / include / asm-um / uaccess.h
index 4e460d6..16c734a 100644 (file)
 
 #define __get_user(x, ptr) \
 ({ \
-       const __typeof__(ptr) __private_ptr = ptr;      \
+       const __typeof__(*(ptr)) __user *__private_ptr = (ptr); \
        __typeof__(x) __private_val;                    \
        int __private_ret = -EFAULT;                    \
        (x) = (__typeof__(*(__private_ptr)))0;                          \
-       if (__copy_from_user((void *) &__private_val, (__private_ptr),  \
+       if (__copy_from_user((__force void *)&__private_val, (__private_ptr),\
                             sizeof(*(__private_ptr))) == 0) {          \
                (x) = (__typeof__(*(__private_ptr))) __private_val;     \
                __private_ret = 0;                                      \
 ({ \
         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); \