Skip to content

Commit 8da46c0

Browse files
Minghao Chipalmer-dabbelt
authored andcommitted
RISC-V: Remove redundant err variable
Return value from user_regset_copyin() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent db3f02d commit 8da46c0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/riscv/kernel/ptrace.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ static int riscv_gpr_set(struct task_struct *target,
4242
unsigned int pos, unsigned int count,
4343
const void *kbuf, const void __user *ubuf)
4444
{
45-
int ret;
4645
struct pt_regs *regs;
4746

4847
regs = task_pt_regs(target);
49-
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, 0, -1);
50-
return ret;
48+
return user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, 0, -1);
5149
}
5250

5351
#ifdef CONFIG_FPU

0 commit comments

Comments
 (0)