public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH v2 16/40] m68k/uaccess: fix sparse errors
       [not found] <1420558883-10131-1-git-send-email-mst@redhat.com>
@ 2015-01-06 15:44 ` Michael S. Tsirkin
  2015-01-07 10:38   ` Geert Uytterhoeven
  2015-01-06 15:45 ` [PATCH v2 36/40] m68k: macro whitespace fixes Michael S. Tsirkin
  1 sibling, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2015-01-06 15:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, linux-arch, Geert Uytterhoeven, linux-m68k

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>
---
 arch/m68k/include/asm/uaccess_mm.h | 40 +++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/arch/m68k/include/asm/uaccess_mm.h b/arch/m68k/include/asm/uaccess_mm.h
index 15901db..d228601 100644
--- a/arch/m68k/include/asm/uaccess_mm.h
+++ b/arch/m68k/include/asm/uaccess_mm.h
@@ -128,25 +128,25 @@ asm volatile ("\n"					\
 #define put_user(x, ptr)	__put_user(x, ptr)
 
 
-#define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({	\
-	type __gu_val;						\
-	asm volatile ("\n"					\
-		"1:	"MOVES"."#bwl"	%2,%1\n"		\
-		"2:\n"						\
-		"	.section .fixup,\"ax\"\n"		\
-		"	.even\n"				\
-		"10:	move.l	%3,%0\n"			\
-		"	sub.l	%1,%1\n"			\
-		"	jra	2b\n"				\
-		"	.previous\n"				\
-		"\n"						\
-		"	.section __ex_table,\"a\"\n"		\
-		"	.align	4\n"				\
-		"	.long	1b,10b\n"			\
-		"	.previous"				\
-		: "+d" (res), "=&" #reg (__gu_val)		\
-		: "m" (*(ptr)), "i" (err));			\
-	(x) = (typeof(*(ptr)))(unsigned long)__gu_val;		\
+#define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({		\
+	type __gu_val;							\
+	asm volatile ("\n"						\
+		"1:	"MOVES"."#bwl"	%2,%1\n"			\
+		"2:\n"							\
+		"	.section .fixup,\"ax\"\n"			\
+		"	.even\n"					\
+		"10:	move.l	%3,%0\n"				\
+		"	sub.l	%1,%1\n"				\
+		"	jra	2b\n"					\
+		"	.previous\n"					\
+		"\n"							\
+		"	.section __ex_table,\"a\"\n"			\
+		"	.align	4\n"					\
+		"	.long	1b,10b\n"				\
+		"	.previous"					\
+		: "+d" (res), "=&" #reg (__gu_val)			\
+		: "m" (*(ptr)), "i" (err));				\
+	(x) = (__force typeof(*(ptr)))(__force unsigned long)__gu_val;	\
 })
 
 #define __get_user(x, ptr)						\
@@ -188,7 +188,7 @@ asm volatile ("\n"					\
 			  "+a" (__gu_ptr)				\
 			: "i" (-EFAULT)					\
 			: "memory");					\
-		(x) = (typeof(*(ptr)))__gu_val;				\
+		(x) = (__force typeof(*(ptr)))__gu_val;			\
 		break;							\
 	    }	*/							\
 	default:							\
-- 
MST

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 36/40] m68k: macro whitespace fixes
       [not found] <1420558883-10131-1-git-send-email-mst@redhat.com>
  2015-01-06 15:44 ` [PATCH v2 16/40] m68k/uaccess: fix sparse errors Michael S. Tsirkin
@ 2015-01-06 15:45 ` Michael S. Tsirkin
  2015-01-07  9:56   ` Geert Uytterhoeven
  1 sibling, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2015-01-06 15:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, linux-arch, Geert Uytterhoeven, linux-m68k

While working on arch/m68k/include/asm/uaccess.h, I noticed
that one macro within this header is made harder to read because it
violates a coding style rule: space is missing after comma.

Fix it up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 arch/m68k/include/asm/segment.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/include/asm/segment.h b/arch/m68k/include/asm/segment.h
index 0fa80e9..98216b8 100644
--- a/arch/m68k/include/asm/segment.h
+++ b/arch/m68k/include/asm/segment.h
@@ -58,7 +58,7 @@ static inline mm_segment_t get_ds(void)
 #define set_fs(x)	(current_thread_info()->addr_limit = (x))
 #endif
 
-#define segment_eq(a,b)	((a).seg == (b).seg)
+#define segment_eq(a, b) ((a).seg == (b).seg)
 
 #endif /* __ASSEMBLY__ */
 
-- 
MST

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 36/40] m68k: macro whitespace fixes
  2015-01-06 15:45 ` [PATCH v2 36/40] m68k: macro whitespace fixes Michael S. Tsirkin
@ 2015-01-07  9:56   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2015-01-07  9:56 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: linux-kernel@vger.kernel.org, Arnd Bergmann, Linux-Arch,
	Linux/m68k

On Tue, Jan 6, 2015 at 4:45 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> While working on arch/m68k/include/asm/uaccess.h, I noticed
> that one macro within this header is made harder to read because it
> violates a coding style rule: space is missing after comma.
>
> Fix it up.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 16/40] m68k/uaccess: fix sparse errors
  2015-01-06 15:44 ` [PATCH v2 16/40] m68k/uaccess: fix sparse errors Michael S. Tsirkin
@ 2015-01-07 10:38   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2015-01-07 10:38 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: linux-kernel@vger.kernel.org, Arnd Bergmann, Linux-Arch,
	Linux/m68k

On Tue, Jan 6, 2015 at 4:44 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> 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>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-07 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1420558883-10131-1-git-send-email-mst@redhat.com>
2015-01-06 15:44 ` [PATCH v2 16/40] m68k/uaccess: fix sparse errors Michael S. Tsirkin
2015-01-07 10:38   ` Geert Uytterhoeven
2015-01-06 15:45 ` [PATCH v2 36/40] m68k: macro whitespace fixes Michael S. Tsirkin
2015-01-07  9:56   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox