Skip to content

Commit

Permalink
[MIPS] Workaround for a sparse warning in include/asm-mips/compat.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Atsushi Nemoto authored and Ralf Baechle committed Jul 13, 2007
1 parent 5e0373b commit 01bebc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/asm-mips/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 01bebc6

Please sign in to comment.