]> err.no Git - linux-2.6/commitdiff
[MIPS] Workaround for a sparse warning in include/asm-mips/compat.h
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Fri, 13 Jul 2007 14:51:38 +0000 (23:51 +0900)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 13 Jul 2007 16:40:01 +0000 (17:40 +0100)
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 (<asn:1>)

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/compat.h

index 432653d7ae09326dafde8ef0b23504ca27b69300..67c3f8ec0303bba4e95fdf1eb00b9638d51d62ac 100644 (file)
@@ -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)