提交 8d2d91e8 编写于 作者: R Ralf Baechle

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: NRalf Baechle <ralf@linux-mips.org>
上级 b6263ff2
...@@ -224,7 +224,7 @@ do { \ ...@@ -224,7 +224,7 @@ do { \
#define __get_user_nocheck(x, ptr, size) \ #define __get_user_nocheck(x, ptr, size) \
({ \ ({ \
long __gu_err; \ int __gu_err; \
\ \
__get_user_common((x), size, ptr); \ __get_user_common((x), size, ptr); \
__gu_err; \ __gu_err; \
...@@ -232,7 +232,7 @@ do { \ ...@@ -232,7 +232,7 @@ do { \
#define __get_user_check(x, ptr, size) \ #define __get_user_check(x, ptr, size) \
({ \ ({ \
long __gu_err = -EFAULT; \ int __gu_err = -EFAULT; \
const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \
\ \
if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \ if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \
...@@ -304,7 +304,7 @@ do { \ ...@@ -304,7 +304,7 @@ do { \
#define __put_user_nocheck(x, ptr, size) \ #define __put_user_nocheck(x, ptr, size) \
({ \ ({ \
__typeof__(*(ptr)) __pu_val; \ __typeof__(*(ptr)) __pu_val; \
long __pu_err = 0; \ int __pu_err = 0; \
\ \
__pu_val = (x); \ __pu_val = (x); \
switch (size) { \ switch (size) { \
...@@ -321,7 +321,7 @@ do { \ ...@@ -321,7 +321,7 @@ do { \
({ \ ({ \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
__typeof__(*(ptr)) __pu_val = (x); \ __typeof__(*(ptr)) __pu_val = (x); \
long __pu_err = -EFAULT; \ int __pu_err = -EFAULT; \
\ \
if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \
switch (size) { \ switch (size) { \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册