avr32/uaccess: fix sparse errors
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 11 Dec 2014 23:56:04 +0000 (01:56 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 13 Jan 2015 13:23:04 +0000 (15:23 +0200)
virtio wants to read bitwise types from userspace using get_user.  At the
moment this triggers sparse errors, since the value is passed through an
integer.

Fix that up using __force.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
arch/avr32/include/asm/uaccess.h

index 245b2ee213c915df2fc353950c3839be93daee88..ccd07c456f9aaa3f4fecdb99ab834b8cc9528d88 100644 (file)
@@ -191,7 +191,7 @@ extern int __put_user_bad(void);
        default: __gu_err = __get_user_bad(); break;                    \
        }                                                               \
                                                                        \
-       x = (typeof(*(ptr)))__gu_val;                                   \
+       x = (__force typeof(*(ptr)))__gu_val;                           \
        __gu_err;                                                       \
 })
 
@@ -222,7 +222,7 @@ extern int __put_user_bad(void);
        } else {                                                        \
                __gu_err = -EFAULT;                                     \
        }                                                               \
-       x = (typeof(*(ptr)))__gu_val;                                   \
+       x = (__force typeof(*(ptr)))__gu_val;                           \
        __gu_err;                                                       \
 })
 
This page took 0.02606 seconds and 5 git commands to generate.