diff options
| author | Ralf Baechle <ralf@linux-mips.org> | 2008-10-11 11:18:50 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2008-10-11 11:18:50 -0400 |
| commit | 8d2d91e86b4153cc2305ec86fe908048f459ff7f (patch) | |
| tree | 07c64a1267d2b6f07da7b4be340e8823baea85a4 /include/asm-mips | |
| parent | b6263ff2d6e58cc2fe615219ab2a06778b5e6cef (diff) | |
MIPS: Optimize get_user and put_user for 64-bit
A long for the error value leads to unnecessary sign extensions. This
patch shrinks an ip27_defconfig kernel build with gcc 4.3.0 by 2256 bytes.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips')
| -rw-r--r-- | include/asm-mips/uaccess.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index 66523d610950..b895144d577a 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h | |||
| @@ -224,7 +224,7 @@ do { \ | |||
| 224 | 224 | ||
| 225 | #define __get_user_nocheck(x, ptr, size) \ | 225 | #define __get_user_nocheck(x, ptr, size) \ |
| 226 | ({ \ | 226 | ({ \ |
| 227 | long __gu_err; \ | 227 | int __gu_err; \ |
| 228 | \ | 228 | \ |
| 229 | __get_user_common((x), size, ptr); \ | 229 | __get_user_common((x), size, ptr); \ |
| 230 | __gu_err; \ | 230 | __gu_err; \ |
| @@ -232,7 +232,7 @@ do { \ | |||
| 232 | 232 | ||
| 233 | #define __get_user_check(x, ptr, size) \ | 233 | #define __get_user_check(x, ptr, size) \ |
| 234 | ({ \ | 234 | ({ \ |
| 235 | long __gu_err = -EFAULT; \ | 235 | int __gu_err = -EFAULT; \ |
| 236 | const __typeof__(*(ptr)) __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))) \ |
| @@ -304,7 +304,7 @@ do { \ | |||
| 304 | #define __put_user_nocheck(x, ptr, size) \ | 304 | #define __put_user_nocheck(x, ptr, size) \ |
| 305 | ({ \ | 305 | ({ \ |
| 306 | __typeof__(*(ptr)) __pu_val; \ | 306 | __typeof__(*(ptr)) __pu_val; \ |
| 307 | long __pu_err = 0; \ | 307 | int __pu_err = 0; \ |
| 308 | \ | 308 | \ |
| 309 | __pu_val = (x); \ | 309 | __pu_val = (x); \ |
| 310 | switch (size) { \ | 310 | switch (size) { \ |
| @@ -321,7 +321,7 @@ do { \ | |||
| 321 | ({ \ | 321 | ({ \ |
| 322 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | 322 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
| 323 | __typeof__(*(ptr)) __pu_val = (x); \ | 323 | __typeof__(*(ptr)) __pu_val = (x); \ |
| 324 | long __pu_err = -EFAULT; \ | 324 | int __pu_err = -EFAULT; \ |
| 325 | \ | 325 | \ |
| 326 | if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ | 326 | if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ |
| 327 | switch (size) { \ | 327 | switch (size) { \ |
