提交 4ab4ba32 编写于 作者: P Petr Tesarik 提交者: Ingo Molnar

x86, tracehook: clean up implementation of syscall_get_error()

The x86-tracehook code now contains this line in syscall_get_error():

	return error >= -4095L ? error : 0;

Hard-wiring a constant is not nice. Let's use the IS_ERR_VALUE macro
from linux/err.h instead.
Signed-off-by: NPetr Tesarik <ptesarik@suse.cz>
Cc: utrace-devel@redhat.com
Acked-by: NRoland McGrath <roland@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 28c3cfd5
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#define _ASM_SYSCALL_H 1 #define _ASM_SYSCALL_H 1
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/err.h>
static inline long syscall_get_nr(struct task_struct *task, static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs) struct pt_regs *regs)
...@@ -47,7 +48,7 @@ static inline long syscall_get_error(struct task_struct *task, ...@@ -47,7 +48,7 @@ static inline long syscall_get_error(struct task_struct *task,
*/ */
error = (long) (int) error; error = (long) (int) error;
#endif #endif
return error >= -4095L ? error : 0; return IS_ERR_VALUE(error) ? error : 0;
} }
static inline long syscall_get_return_value(struct task_struct *task, static inline long syscall_get_return_value(struct task_struct *task,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册