From: Michael Karcher Date: Wed, 22 Jul 2020 23:13:22 +0000 (+0200) Subject: sh: bring syscall_set_return_value in line with other architectures X-Git-Tag: baikal/mips/sdk5.9~12876^2~1 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=8b92abf3dd2e7b9fb92e44f8b8c59ed87f6a2faf;p=kernel.git 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 Tested-by: John Paul Adrian Glaubitz Signed-off-by: Rich Felker --- diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h index 0b5b8e75edacc..cb51a75283842 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,