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

m32r/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/m32r/include/asm/uaccess.h
··· 218 218 unsigned long __gu_val; \ 219 219 might_fault(); \ 220 220 __get_user_size(__gu_val,(ptr),(size),__gu_err); \ 221 - (x) = (__typeof__(*(ptr)))__gu_val; \ 221 + (x) = (__force __typeof__(*(ptr)))__gu_val; \ 222 222 __gu_err; \ 223 223 }) 224 224 ··· 230 230 might_fault(); \ 231 231 if (access_ok(VERIFY_READ,__gu_addr,size)) \ 232 232 __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \ 233 - (x) = (__typeof__(*(ptr)))__gu_val; \ 233 + (x) = (__force __typeof__(*(ptr)))__gu_val; \ 234 234 __gu_err; \ 235 235 }) 236 236