diff options
Diffstat (limited to 'arch/sh/include/asm/syscall_32.h')
-rw-r--r-- | arch/sh/include/asm/syscall_32.h | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h index 05a868a71ef5..5bc34681d994 100644 --- a/arch/sh/include/asm/syscall_32.h +++ b/arch/sh/include/asm/syscall_32.h | |||
@@ -21,23 +21,10 @@ static inline void syscall_rollback(struct task_struct *task, | |||
21 | */ | 21 | */ |
22 | } | 22 | } |
23 | 23 | ||
24 | static inline bool syscall_has_error(struct pt_regs *regs) | ||
25 | { | ||
26 | return (regs->sr & 0x1) ? true : false; | ||
27 | } | ||
28 | static inline void syscall_set_error(struct pt_regs *regs) | ||
29 | { | ||
30 | regs->sr |= 0x1; | ||
31 | } | ||
32 | static inline void syscall_clear_error(struct pt_regs *regs) | ||
33 | { | ||
34 | regs->sr &= ~0x1; | ||
35 | } | ||
36 | |||
37 | static inline long syscall_get_error(struct task_struct *task, | 24 | static inline long syscall_get_error(struct task_struct *task, |
38 | struct pt_regs *regs) | 25 | struct pt_regs *regs) |
39 | { | 26 | { |
40 | return syscall_has_error(regs) ? regs->regs[0] : 0; | 27 | return IS_ERR_VALUE(regs->regs[0]) ? regs->regs[0] : 0; |
41 | } | 28 | } |
42 | 29 | ||
43 | static inline long syscall_get_return_value(struct task_struct *task, | 30 | static inline long syscall_get_return_value(struct task_struct *task, |
@@ -50,13 +37,10 @@ static inline void syscall_set_return_value(struct task_struct *task, | |||
50 | struct pt_regs *regs, | 37 | struct pt_regs *regs, |
51 | int error, long val) | 38 | int error, long val) |
52 | { | 39 | { |
53 | if (error) { | 40 | if (error) |
54 | syscall_set_error(regs); | ||
55 | regs->regs[0] = -error; | 41 | regs->regs[0] = -error; |
56 | } else { | 42 | else |
57 | syscall_clear_error(regs); | ||
58 | regs->regs[0] = val; | 43 | regs->regs[0] = val; |
59 | } | ||
60 | } | 44 | } |
61 | 45 | ||
62 | static inline void syscall_get_arguments(struct task_struct *task, | 46 | static inline void syscall_get_arguments(struct task_struct *task, |