Skip to content

Commit ea18d43

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Make compute_return_era() return void
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 <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent ad82eef commit ea18d43

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

arch/loongarch/include/asm/branch.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ static inline unsigned long exception_era(struct pt_regs *regs)
1212
return regs->csr_era;
1313
}
1414

15-
static inline int compute_return_era(struct pt_regs *regs)
15+
static inline void compute_return_era(struct pt_regs *regs)
1616
{
1717
regs->csr_era += 4;
18-
return 0;
1918
}
2019

2120
#endif /* _ASM_BRANCH_H */

arch/loongarch/kernel/traps.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,7 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs)
475475

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

478-
if (unlikely(compute_return_era(regs) < 0))
479-
goto out;
478+
compute_return_era(regs);
480479

481480
if (unlikely(get_user(opcode, era) < 0)) {
482481
status = SIGSEGV;

0 commit comments

Comments
 (0)