| To: | linux-mips@linux-mips.org |
|---|---|
| Subject: | [PATCH] Workaround for a sparse warning in include/asm-mips/compat.h |
| From: | Atsushi Nemoto <anemo@mba.ocn.ne.jp> |
| Date: | Fri, 13 Jul 2007 23:51:38 +0900 (JST) |
| Cc: | ralf@linux-mips.org |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| Sender: | linux-mips-bounce@linux-mips.org |
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>
---
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index 432653d..67c3f8e 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)
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] sb1250-duart.c: SB1250 DUART serial support, Ralf Baechle |
|---|---|
| Next by Date: | [PATCH] Make show_code static and add __user tag, Atsushi Nemoto |
| Previous by Thread: | [PATCH] Add some __user tags, Atsushi Nemoto |
| Next by Thread: | Re: [PATCH] Workaround for a sparse warning in include/asm-mips/compat.h, Ralf Baechle |
| Indexes: | [Date] [Thread] [Top] [All Lists] |