Skip to contentSkip to conversation

microblaze: fix syscall_set_return_value()

PATCH New Dmitry V. Levin 1 participant 1 message Dec 3, 2018 Microblaze architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 microblaze: fix syscall_set_return_value()

According to documentation in include/asm-generic/syscall.h, if error argument of syscall_set_return_value() is nonzero, it is a negated errno.

This change fixes syscall_set_return_value() implementation on microblaze to match its own syscall_get_error(), the documentation, and other architectures where error argument of syscall_set_return_value() is non-positive.

Fixes d5b37092aae1e ("microblaze: Implement include/asm/syscall.h.")
Cc [email protected] # v2.6.32+
---
 arch/microblaze/include/asm/syscall.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/microblaze/include/asm/syscall.h +1 -4
index 220decd605a4..c2489a591d6b 100644
@@ -36,10 +36,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
 					    struct pt_regs *regs,
 					    int error, long val)
 {
-	if (error)
-		regs->r3 = -error;
-	else
-		regs->r3 = val;
+	regs->r3 = error ?: val;
 }
 
 static inline microblaze_reg_t microblaze_get_syscall_arg(struct pt_regs *regs,
Signature · 1 line
ldv