Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -2
+2 -2
arch/metag/include/asm/uaccess.h
··· 135 135 ({ \ 136 136 long __gu_err, __gu_val; \ 137 137 __get_user_size(__gu_val, (ptr), (size), __gu_err); \ 138 - (x) = (__typeof__(*(ptr)))__gu_val; \ 138 + (x) = (__force __typeof__(*(ptr)))__gu_val; \ 139 139 __gu_err; \ 140 140 }) 141 141 ··· 145 145 const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ 146 146 if (access_ok(VERIFY_READ, __gu_addr, size)) \ 147 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 149 __gu_err; \ 150 150 }) 151 151