Commit 4255a8e199a00faa29b84c47ad57427dd1412581

Authored by Michael S. Tsirkin
Committed by Chris Zankel
1 parent 2cb54e8493

xtensa/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>
Signed-off-by: Chris Zankel <chris@zankel.net>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

arch/xtensa/include/asm/uaccess.h
... ... @@ -320,7 +320,7 @@
320 320 ({ \
321 321 long __gu_err, __gu_val; \
322 322 __get_user_size(__gu_val,(ptr),(size),__gu_err); \
323   - (x) = (__typeof__(*(ptr)))__gu_val; \
  323 + (x) = (__force __typeof__(*(ptr)))__gu_val; \
324 324 __gu_err; \
325 325 })
326 326  
... ... @@ -330,7 +330,7 @@
330 330 const __typeof__(*(ptr)) *__gu_addr = (ptr); \
331 331 if (access_ok(VERIFY_READ,__gu_addr,size)) \
332 332 __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \
333   - (x) = (__typeof__(*(ptr)))__gu_val; \
  333 + (x) = (__force __typeof__(*(ptr)))__gu_val; \
334 334 __gu_err; \
335 335 })
336 336