Skip to content

Commit

Permalink
microblaze/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.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
Michael S. Tsirkin authored and Michal Simek committed Jan 8, 2015
1 parent 231856a commit 0774bf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/microblaze/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ extern long __user_bad(void);
} else { \
__gu_err = -EFAULT; \
} \
x = (typeof(*(ptr)))__gu_val; \
x = (__force typeof(*(ptr)))__gu_val; \
__gu_err; \
})

Expand All @@ -242,7 +242,7 @@ extern long __user_bad(void);
default: \
/* __gu_val = 0; __gu_err = -EINVAL;*/ __gu_err = __user_bad();\
} \
x = (__typeof__(*(ptr))) __gu_val; \
x = (__force __typeof__(*(ptr))) __gu_val; \
__gu_err; \
})

Expand Down

0 comments on commit 0774bf6

Please sign in to comment.