diff options
author | Ley Foon Tan <lftan@altera.com> | 2014-12-17 00:53:41 -0500 |
---|---|---|
committer | Ley Foon Tan <lftan@altera.com> | 2014-12-17 00:53:41 -0500 |
commit | f1f2eac9124bf0dc82b652871f9a596bce2d3e10 (patch) | |
tree | 0069531d60de4d0dbfbd4d121f10c998cd4f6023 /arch | |
parent | d1e4ef04244fc67f4f2ee001a84a6562f569f437 (diff) |
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 <mst@redhat.com>
Signed-off-by: Ley Foon Tan <lftan@altera.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/nios2/include/asm/uaccess.h | 4 |
1 files changed, 2 insertions, 2 deletions
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 { \ | |||
168 | const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ | 168 | const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ |
169 | unsigned long __gu_val; \ | 169 | unsigned long __gu_val; \ |
170 | __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\ | 170 | __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\ |
171 | (x) = (__typeof__(x))__gu_val; \ | 171 | (x) = (__force __typeof__(x))__gu_val; \ |
172 | __gu_err; \ | 172 | __gu_err; \ |
173 | }) | 173 | }) |
174 | 174 | ||
@@ -180,7 +180,7 @@ do { \ | |||
180 | if (access_ok(VERIFY_READ, __gu_ptr, sizeof(*__gu_ptr))) \ | 180 | if (access_ok(VERIFY_READ, __gu_ptr, sizeof(*__gu_ptr))) \ |
181 | __get_user_common(__gu_val, sizeof(*__gu_ptr), \ | 181 | __get_user_common(__gu_val, sizeof(*__gu_ptr), \ |
182 | __gu_ptr, __gu_err); \ | 182 | __gu_ptr, __gu_err); \ |
183 | (x) = (__typeof__(x))__gu_val; \ | 183 | (x) = (__force __typeof__(x))__gu_val; \ |
184 | __gu_err; \ | 184 | __gu_err; \ |
185 | }) | 185 | }) |
186 | 186 | ||