From 01bebc66793f2cc65104452dc319a8a99f005934 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Fri, 13 Jul 2007 23:51:38 +0900 Subject: [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 --- include/asm-mips/compat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index 432653d7ae0..67c3f8ec030 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) -- cgit v1.2.3-70-g09d2 From f24ae12b3eeb1b956b752d4d5907e311cfa95a1a Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Sat, 14 Jul 2007 00:06:44 +0900 Subject: [MIPS] Workaround for a sparse warning in include/asm-mips/mach-tx4927/ioremap.h include2/asm/mach-tx49xx/ioremap.h:39:52: warning: cast truncates bits from constant value (fff000000 becomes ff000000) Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- include/asm-mips/mach-tx49xx/ioremap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-mips/mach-tx49xx/ioremap.h b/include/asm-mips/mach-tx49xx/ioremap.h index 88cf546719b..1e7beae7222 100644 --- a/include/asm-mips/mach-tx49xx/ioremap.h +++ b/include/asm-mips/mach-tx49xx/ioremap.h @@ -36,7 +36,8 @@ static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, static inline int plat_iounmap(const volatile void __iomem *addr) { - return (unsigned long)addr >= (unsigned long)(int)TXX9_DIRECTMAP_BASE; + return (unsigned long)addr >= + (unsigned long)(int)(TXX9_DIRECTMAP_BASE & 0xffffffff); } #endif /* __ASM_MACH_TX49XX_IOREMAP_H */ -- cgit v1.2.3-70-g09d2