[PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()
Dmitry V. Levin
ldv at strace.io
Mon Jan 27 22:20:23 AEDT 2025
On Thu, Jan 23, 2025 at 11:07:21PM +0100, Christophe Leroy wrote:
[...]
> To add a bit more to the confusion,
Looks like there is no end to it:
static inline long regs_return_value(struct pt_regs *regs)
{
if (trap_is_scv(regs))
return regs->gpr[3];
if (is_syscall_success(regs))
return regs->gpr[3];
else
return -regs->gpr[3];
}
static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc)
{
regs->gpr[3] = rc;
}
This doesn't look consistent, does it?
--
ldv
More information about the Linuxppc-dev
mailing list