diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-12-11 18:56:04 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-01-13 08:23:28 -0500 |
commit | 09a2f7cf6a89ec011bda8c0f0f8d0790a1176973 (patch) | |
tree | 8d0570c9e7bdf2317b10b0280c50c93631698fae | |
parent | 1d638efce8cc77c1ec838886e9a64f98aa58b780 (diff) |
m68k/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: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r-- | arch/m68k/include/asm/uaccess_mm.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/arch/m68k/include/asm/uaccess_mm.h b/arch/m68k/include/asm/uaccess_mm.h index 15901db435b9..d228601b3afc 100644 --- a/arch/m68k/include/asm/uaccess_mm.h +++ b/arch/m68k/include/asm/uaccess_mm.h | |||
@@ -128,25 +128,25 @@ asm volatile ("\n" \ | |||
128 | #define put_user(x, ptr) __put_user(x, ptr) | 128 | #define put_user(x, ptr) __put_user(x, ptr) |
129 | 129 | ||
130 | 130 | ||
131 | #define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \ | 131 | #define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \ |
132 | type __gu_val; \ | 132 | type __gu_val; \ |
133 | asm volatile ("\n" \ | 133 | asm volatile ("\n" \ |
134 | "1: "MOVES"."#bwl" %2,%1\n" \ | 134 | "1: "MOVES"."#bwl" %2,%1\n" \ |
135 | "2:\n" \ | 135 | "2:\n" \ |
136 | " .section .fixup,\"ax\"\n" \ | 136 | " .section .fixup,\"ax\"\n" \ |
137 | " .even\n" \ | 137 | " .even\n" \ |
138 | "10: move.l %3,%0\n" \ | 138 | "10: move.l %3,%0\n" \ |
139 | " sub.l %1,%1\n" \ | 139 | " sub.l %1,%1\n" \ |
140 | " jra 2b\n" \ | 140 | " jra 2b\n" \ |
141 | " .previous\n" \ | 141 | " .previous\n" \ |
142 | "\n" \ | 142 | "\n" \ |
143 | " .section __ex_table,\"a\"\n" \ | 143 | " .section __ex_table,\"a\"\n" \ |
144 | " .align 4\n" \ | 144 | " .align 4\n" \ |
145 | " .long 1b,10b\n" \ | 145 | " .long 1b,10b\n" \ |
146 | " .previous" \ | 146 | " .previous" \ |
147 | : "+d" (res), "=&" #reg (__gu_val) \ | 147 | : "+d" (res), "=&" #reg (__gu_val) \ |
148 | : "m" (*(ptr)), "i" (err)); \ | 148 | : "m" (*(ptr)), "i" (err)); \ |
149 | (x) = (typeof(*(ptr)))(unsigned long)__gu_val; \ | 149 | (x) = (__force typeof(*(ptr)))(__force unsigned long)__gu_val; \ |
150 | }) | 150 | }) |
151 | 151 | ||
152 | #define __get_user(x, ptr) \ | 152 | #define __get_user(x, ptr) \ |
@@ -188,7 +188,7 @@ asm volatile ("\n" \ | |||
188 | "+a" (__gu_ptr) \ | 188 | "+a" (__gu_ptr) \ |
189 | : "i" (-EFAULT) \ | 189 | : "i" (-EFAULT) \ |
190 | : "memory"); \ | 190 | : "memory"); \ |
191 | (x) = (typeof(*(ptr)))__gu_val; \ | 191 | (x) = (__force typeof(*(ptr)))__gu_val; \ |
192 | break; \ | 192 | break; \ |
193 | } */ \ | 193 | } */ \ |
194 | default: \ | 194 | default: \ |