提交 ee64baf4 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

s390/uaccess: use __builtin_expect for get_user/put_user

We always expect that get_user and put_user return with zero. Give the
compiler a hint so it can slightly optimize the code and avoid
branches.
This is the same what x86 got with commit a76cf66e ("x86/uaccess:
Tell the compiler that uaccess is unlikely to fault").
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 b8ac5e2f
......@@ -191,7 +191,7 @@ static inline int __get_user_fn(void *x, const void __user *ptr, unsigned long s
__put_user_bad(); \
break; \
} \
__pu_err; \
__builtin_expect(__pu_err, 0); \
})
#define put_user(x, ptr) \
......@@ -240,7 +240,7 @@ int __put_user_bad(void) __attribute__((noreturn));
__get_user_bad(); \
break; \
} \
__gu_err; \
__builtin_expect(__gu_err, 0); \
})
#define get_user(x, ptr) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册