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

cris/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/cris/include/asm/uaccess.h
··· 153 153 ({ \ 154 154 long __gu_err, __gu_val; \ 155 155 __get_user_size(__gu_val,(ptr),(size),__gu_err); \ 156 - (x) = (__typeof__(*(ptr)))__gu_val; \ 156 + (x) = (__force __typeof__(*(ptr)))__gu_val; \ 157 157 __gu_err; \ 158 158 }) 159 159 ··· 163 163 const __typeof__(*(ptr)) *__gu_addr = (ptr); \ 164 164 if (access_ok(VERIFY_READ,__gu_addr,size)) \ 165 165 __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \ 166 - (x) = (__typeof__(*(ptr)))__gu_val; \ 166 + (x) = (__force __typeof__(*(ptr)))__gu_val; \ 167 167 __gu_err; \ 168 168 }) 169 169