public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix x86_64 put_user() sparse warnings
@ 2004-12-16  1:34 Roland Dreier
  0 siblings, 0 replies; only message in thread
From: Roland Dreier @ 2004-12-16  1:34 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

This may not be 2.6.10 material -- if not please queue for 2.6.11.

Thanks,
  Roland


Fix sparse warnings

    warning: cast removes address space of expression

for uses of put_user() on x86_64 caused by doing __m(addr) in
__put_user_asm() with addr a __user pointer.

Signed-off-by: Roland Dreier <roland@topspin.com>

Index: linux-bk/include/asm-x86_64/uaccess.h
===================================================================
--- linux-bk.orig/include/asm-x86_64/uaccess.h	2004-12-11 15:16:44.000000000 -0800
+++ linux-bk/include/asm-x86_64/uaccess.h	2004-12-15 15:35:47.482091664 -0800
@@ -172,7 +172,7 @@
 
 /* FIXME: this hack is definitely wrong -AK */
 struct __large_struct { unsigned long buf[100]; };
-#define __m(x) (*(struct __large_struct *)(x))
+#define __m(x) (*(struct __large_struct __user *)(x))
 
 /*
  * Tell gcc we read from memory instead of writing: this is because

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-16  1:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-16  1:34 [PATCH] Fix x86_64 put_user() sparse warnings Roland Dreier

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