All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] LoongArch: simplify code in apply_r_larch_sop_push_dup
@ 2022-09-17  6:53 williamsukatube
  0 siblings, 0 replies; only message in thread
From: williamsukatube @ 2022-09-17  6:53 UTC (permalink / raw)
  To: chenhuacai, loongarch, linux-kernel; +Cc: kernel, William Dean

From: William Dean <williamsukatube@163.com>

It could directly return 'rela_stack_push' to simplify code.

Signed-off-by: William Dean <williamsukatube@163.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-17  6:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17  6:53 [PATCH -next] LoongArch: simplify code in apply_r_larch_sop_push_dup williamsukatube

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.