[PATCH -next] LoongArch: simplify code in apply_r_larch_sop_push_dup
From: williamsukatube
Date: Sat Sep 17 2022 - 02:54:28 EST
From: William Dean <williamsukatube@xxxxxxx>
It could directly return 'rela_stack_push' to simplify code.
Signed-off-by: William Dean <williamsukatube@xxxxxxx>
---
arch/loongarch/kernel/module.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/loongarch/kernel/module.c b/arch/loongarch/kernel/module.c
index 638427ff0d51..a8f90d51d9ae 100644
--- a/arch/loongarch/kernel/module.c
+++ b/arch/loongarch/kernel/module.c
@@ -99,13 +99,10 @@ static int apply_r_larch_sop_push_dup(struct module *mod, u32 *location, Elf_Add
if (err)
return err;
err = rela_stack_push(opr1, rela_stack, rela_stack_top);
- if (err)
- return err;
- err = rela_stack_push(opr1, rela_stack, rela_stack_top);
if (err)
return err;
- return 0;
+ return rela_stack_push(opr1, rela_stack, rela_stack_top);
}
static int apply_r_larch_sop_push_plt_pcrel(struct module *mod, u32 *location, Elf_Addr v,
--
2.25.1