]> git.baikalelectronics.ru Git - kernel.git/commitdiff
LoongArch: Make compute_return_era() return void
authorTiezhu Yang <yangtiezhu@loongson.cn>
Sat, 18 Jun 2022 08:39:11 +0000 (16:39 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Sat, 25 Jun 2022 10:06:07 +0000 (18:06 +0800)
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>
arch/loongarch/include/asm/branch.h
arch/loongarch/kernel/traps.c

index 3f33c89f35b487bffe9e232ccb9f151862415d12..9a133e4c068e26c98fce575e67a1c174b2e0be03 100644 (file)
@@ -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 */
index e4060f84a22169d71bdeafab3328777277fea2e1..1bf58c65e2bf0cc4afa7d38cdd434521d184d3b3 100644 (file)
@@ -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;