Skip to contentSkip to conversation

Fix x86_64 put_user() sparse warnings

PATCH New Roland Dreier 1 participant 1 message Dec 16, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix x86_64 put_user() sparse warnings

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.

include/asm-x86_64/uaccess.h +1 -1
Index: linux-bk/include/asm-x86_64/uaccess.h
===================================================================
@@ -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