From: Atsushi Nemoto Date: Fri, 13 Jul 2007 14:51:38 +0000 (+0900) Subject: [MIPS] Workaround for a sparse warning in include/asm-mips/compat.h X-Git-Tag: v2.6.23-rc1~1079^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01bebc66793f2cc65104452dc319a8a99f005934;p=linux-2.6 [MIPS] Workaround for a sparse warning in include/asm-mips/compat.h Cast to a __user pointer via "unsigned long" to get rid of this warning: include2/asm/compat.h:135:10: warning: cast adds address space to expression () Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index 432653d7ae..67c3f8ec03 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h @@ -132,7 +132,8 @@ typedef u32 compat_uptr_t; static inline void __user *compat_ptr(compat_uptr_t uptr) { - return (void __user *)(long)uptr; + /* cast to a __user pointer via "unsigned long" makes sparse happy */ + return (void __user *)(unsigned long)(long)uptr; } static inline compat_uptr_t ptr_to_compat(void __user *uptr)