From f1f2eac9124bf0dc82b652871f9a596bce2d3e10 Mon Sep 17 00:00:00 2001 From: Ley Foon Tan Date: Wed, 17 Dec 2014 13:53:41 +0800 Subject: nios2/uaccess: fix sparse errors 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 Signed-off-by: Ley Foon Tan --- arch/nios2/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/nios2/include/asm/uaccess.h b/arch/nios2/include/asm/uaccess.h index acedc0a2860e..caa51ff85a3c 100644 --- a/arch/nios2/include/asm/uaccess.h +++ b/arch/nios2/include/asm/uaccess.h @@ -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; \ }) @@ -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; \ }) -- cgit v1.2.2