diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-02-14 06:57:50 (GMT) |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-02-21 16:58:22 (GMT) |
commit | 8ecbbcaf08c13c57d6602472478739d64650ee0e (patch) | |
tree | c59cf7f91e45bf95f7e9b85f43d524f3cf627505 /include/asm-mips/uaccess.h | |
parent | 36ccf1c0e3917f1f73abc17c38ad704c59f8d1b6 (diff) | |
download | linux-8ecbbcaf08c13c57d6602472478739d64650ee0e.tar.xz |
[MIPS] Fixes for uaccess.h with gcc >= 4.0.1
It seems current get_user() incorrectly sign-extend an unsigned int
value on 64bit kernel. I think this is because '(__typeof__(val))'
cast in final assignment. I suppose the cast should be
'(__typeof__(*(addr))'.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/uaccess.h')
-rw-r--r-- | include/asm-mips/uaccess.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index 7a553e9..b96f3e0 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h @@ -233,7 +233,7 @@ do { \ #define __get_user_check(x,ptr,size) \ ({ \ long __gu_err = -EFAULT; \ - const void __user * __gu_ptr = (ptr); \ + const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ \ if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \ __get_user_common((x), size, __gu_ptr); \ @@ -258,7 +258,7 @@ do { \ : "=r" (__gu_err), "=r" (__gu_tmp) \ : "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \ \ - (val) = (__typeof__(val)) __gu_tmp; \ + (val) = (__typeof__(*(addr))) __gu_tmp; \ } /* @@ -284,7 +284,7 @@ do { \ " .previous \n" \ : "=r" (__gu_err), "=&r" (__gu_tmp) \ : "0" (0), "r" (addr), "i" (-EFAULT)); \ - (val) = __gu_tmp; \ + (val) = (__typeof__(*(addr))) __gu_tmp; \ } /* |