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

openrisc/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>

+2 -2
+2 -2
arch/openrisc/include/asm/uaccess.h
··· 192 192 ({ \ 193 193 long __gu_err, __gu_val; \ 194 194 __get_user_size(__gu_val, (ptr), (size), __gu_err); \ 195 - (x) = (__typeof__(*(ptr)))__gu_val; \ 195 + (x) = (__force __typeof__(*(ptr)))__gu_val; \ 196 196 __gu_err; \ 197 197 }) 198 198 ··· 202 202 const __typeof__(*(ptr)) * __gu_addr = (ptr); \ 203 203 if (access_ok(VERIFY_READ, __gu_addr, size)) \ 204 204 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ 205 - (x) = (__typeof__(*(ptr)))__gu_val; \ 205 + (x) = (__force __typeof__(*(ptr)))__gu_val; \ 206 206 __gu_err; \ 207 207 }) 208 208