[PATCH] Fix x86_64 put_user() sparse warnings

From: Roland Dreier
Date: Wed Dec 15 2004 - 20:49:35 EST


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@xxxxxxxxxxx>

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/