Skip to content

Commit

Permalink
x86, tracehook: clean up implementation of syscall_get_error()
Browse files Browse the repository at this point in the history
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: Petr Tesarik <ptesarik@suse.cz>
Cc: utrace-devel@redhat.com
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Petr Tesarik authored and Ingo Molnar committed Sep 5, 2008
1 parent 28c3cfd commit 4ab4ba3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/asm-x86/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define _ASM_SYSCALL_H 1

#include <linux/sched.h>
#include <linux/err.h>

static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs)
Expand Down Expand Up @@ -47,7 +48,7 @@ static inline long syscall_get_error(struct task_struct *task,
*/
error = (long) (int) error;
#endif
return error >= -4095L ? error : 0;
return IS_ERR_VALUE(error) ? error : 0;
}

static inline long syscall_get_return_value(struct task_struct *task,
Expand Down

0 comments on commit 4ab4ba3

Please sign in to comment.