summaryrefslogtreecommitdiff
path: root/arch/sh/include
diff options
context:
space:
mode:
authorMichael Karcher <kernel@mkarcher.dialup.fu-berlin.de>2020-07-23 02:13:22 +0300
committerRich Felker <dalias@libc.org>2020-08-15 05:05:20 +0300
commit03dd061f0d203c3479791490d6b9359b2eaf9fec (patch)
tree7951b71d800e3034c52ee092f1b825745d6fd156 /arch/sh/include
parent0bb605c2c7f2b4b314b91510810b226de7f34fa1 (diff)
downloadlinux-03dd061f0d203c3479791490d6b9359b2eaf9fec.tar.xz
sh: bring syscall_set_return_value in line with other architectures
Other architectures expect that syscall_set_return_value gets an already negative value as error. That's also what kernel/seccomp.c provides. Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de> Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Rich Felker <dalias@libc.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r--arch/sh/include/asm/syscall_32.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h
index 0b5b8e75edac..cb51a7528384 100644
--- a/arch/sh/include/asm/syscall_32.h
+++ b/arch/sh/include/asm/syscall_32.h
@@ -40,10 +40,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
struct pt_regs *regs,
int error, long val)
{
- if (error)
- regs->regs[0] = -error;
- else
- regs->regs[0] = val;
+ regs->regs[0] = (long) error ?: val;
}
static inline void syscall_get_arguments(struct task_struct *task,