diff options
| author | Michael S. Tsirkin <mst@redhat.com> | 2014-12-11 18:56:04 -0500 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2015-01-13 08:23:15 -0500 |
| commit | 8f4e4c1aef356ac4ce67caeffac29af4971fe048 (patch) | |
| tree | bc7b64a2eccba11720a891aeb5f50a9a2ecc5d4f | |
| parent | a618337e8cd811f07bd660a857d5d9f0201f042b (diff) | |
metag/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.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
| -rw-r--r-- | arch/metag/include/asm/uaccess.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/metag/include/asm/uaccess.h b/arch/metag/include/asm/uaccess.h index 0748b0a97986..fd863fead4af 100644 --- a/arch/metag/include/asm/uaccess.h +++ b/arch/metag/include/asm/uaccess.h | |||
| @@ -135,7 +135,7 @@ extern long __get_user_bad(void); | |||
| 135 | ({ \ | 135 | ({ \ |
| 136 | long __gu_err, __gu_val; \ | 136 | long __gu_err, __gu_val; \ |
| 137 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 137 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ |
| 138 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 138 | (x) = (__force __typeof__(*(ptr)))__gu_val; \ |
| 139 | __gu_err; \ | 139 | __gu_err; \ |
| 140 | }) | 140 | }) |
| 141 | 141 | ||
| @@ -145,7 +145,7 @@ extern long __get_user_bad(void); | |||
| 145 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | 145 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ |
| 146 | if (access_ok(VERIFY_READ, __gu_addr, size)) \ | 146 | if (access_ok(VERIFY_READ, __gu_addr, size)) \ |
| 147 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | 147 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ |
| 148 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 148 | (x) = (__force __typeof__(*(ptr)))__gu_val; \ |
| 149 | __gu_err; \ | 149 | __gu_err; \ |
| 150 | }) | 150 | }) |
| 151 | 151 | ||
