Skip to content

Commit

Permalink
nios2/uaccess: fix sparse errors
Browse files Browse the repository at this point in the history
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.

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Ley Foon Tan <lftan@altera.com>
  • Loading branch information
Ley Foon Tan committed Dec 17, 2014
1 parent d1e4ef0 commit f1f2eac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/nios2/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ do { \
const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \
unsigned long __gu_val; \
__get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\
(x) = (__typeof__(x))__gu_val; \
(x) = (__force __typeof__(x))__gu_val; \
__gu_err; \
})

Expand All @@ -180,7 +180,7 @@ do { \
if (access_ok(VERIFY_READ, __gu_ptr, sizeof(*__gu_ptr))) \
__get_user_common(__gu_val, sizeof(*__gu_ptr), \
__gu_ptr, __gu_err); \
(x) = (__typeof__(x))__gu_val; \
(x) = (__force __typeof__(x))__gu_val; \
__gu_err; \
})

Expand Down

0 comments on commit f1f2eac

Please sign in to comment.