diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-02-14 01:57:50 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-02-21 11:58:22 -0500 |
commit | 8ecbbcaf08c13c57d6602472478739d64650ee0e (patch) | |
tree | c59cf7f91e45bf95f7e9b85f43d524f3cf627505 | |
parent | 36ccf1c0e3917f1f73abc17c38ad704c59f8d1b6 (diff) |
[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>
-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 7a553e9d44d3..b96f3e0f3933 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h | |||
@@ -233,7 +233,7 @@ do { \ | |||
233 | #define __get_user_check(x,ptr,size) \ | 233 | #define __get_user_check(x,ptr,size) \ |
234 | ({ \ | 234 | ({ \ |
235 | long __gu_err = -EFAULT; \ | 235 | long __gu_err = -EFAULT; \ |
236 | const void __user * __gu_ptr = (ptr); \ | 236 | const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ |
237 | \ | 237 | \ |
238 | if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \ | 238 | if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \ |
239 | __get_user_common((x), size, __gu_ptr); \ | 239 | __get_user_common((x), size, __gu_ptr); \ |
@@ -258,7 +258,7 @@ do { \ | |||
258 | : "=r" (__gu_err), "=r" (__gu_tmp) \ | 258 | : "=r" (__gu_err), "=r" (__gu_tmp) \ |
259 | : "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \ | 259 | : "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \ |
260 | \ | 260 | \ |
261 | (val) = (__typeof__(val)) __gu_tmp; \ | 261 | (val) = (__typeof__(*(addr))) __gu_tmp; \ |
262 | } | 262 | } |
263 | 263 | ||
264 | /* | 264 | /* |
@@ -284,7 +284,7 @@ do { \ | |||
284 | " .previous \n" \ | 284 | " .previous \n" \ |
285 | : "=r" (__gu_err), "=&r" (__gu_tmp) \ | 285 | : "=r" (__gu_err), "=&r" (__gu_tmp) \ |
286 | : "0" (0), "r" (addr), "i" (-EFAULT)); \ | 286 | : "0" (0), "r" (addr), "i" (-EFAULT)); \ |
287 | (val) = __gu_tmp; \ | 287 | (val) = (__typeof__(*(addr))) __gu_tmp; \ |
288 | } | 288 | } |
289 | 289 | ||
290 | /* | 290 | /* |