Skip to content

Commit

Permalink
LoongArch: Make compute_return_era() return void
Browse files Browse the repository at this point in the history
compute_return_era() always returns 0, make it return void,
and then no need to check its return value for its callers.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
  • Loading branch information
Tiezhu Yang authored and Huacai Chen committed Jun 25, 2022
1 parent ad82eef commit ea18d43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions arch/loongarch/include/asm/branch.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ static inline unsigned long exception_era(struct pt_regs *regs)
return regs->csr_era;
}

static inline int compute_return_era(struct pt_regs *regs)
static inline void compute_return_era(struct pt_regs *regs)
{
regs->csr_era += 4;
return 0;
}

#endif /* _ASM_BRANCH_H */
3 changes: 1 addition & 2 deletions arch/loongarch/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,7 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs)

die_if_kernel("Reserved instruction in kernel code", regs);

if (unlikely(compute_return_era(regs) < 0))
goto out;
compute_return_era(regs);

if (unlikely(get_user(opcode, era) < 0)) {
status = SIGSEGV;
Expand Down

0 comments on commit ea18d43

Please sign in to comment.