Skip to contentSkip to conversation

LoongArch: simplify code in apply_r_larch_sop_push_dup

PATCH New [email protected] 1 participant 1 message Sep 17, 2022 LoongArch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LoongArch: simplify code in apply_r_larch_sop_push_dup

From: William Dean <[email protected]>

It could directly return 'rela_stack_push' to simplify code.

---
 arch/loongarch/kernel/module.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/loongarch/kernel/module.c +1 -4
index 638427ff0d51..a8f90d51d9ae 100644
@@ -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