2022-09-17 06:59:09

by williamsukatube

[permalink] [raw]
Subject: [PATCH -next] 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.

Signed-off-by: William Dean <[email protected]>
---
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