loongarch.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] loongarch: kgdb: remove unnecessary init variable
@ 2025-05-30  7:09 Li Jun
  2025-06-03  1:20 ` Yanteng Si
  0 siblings, 1 reply; 6+ messages in thread
From: Li Jun @ 2025-05-30  7:09 UTC (permalink / raw)
  To: chenhuacai, kernel, lijun01, loongarch

the get_step_address(regs, &addr) should assign a value
to 'error' before it is read.so the var don't need init
to 0.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
 arch/loongarch/kernel/kgdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/kernel/kgdb.c b/arch/loongarch/kernel/kgdb.c
index 7be5b4c0c900..df3c7a5565e9 100644
--- a/arch/loongarch/kernel/kgdb.c
+++ b/arch/loongarch/kernel/kgdb.c
@@ -379,7 +379,7 @@ static int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
 
 static int do_single_step(struct pt_regs *regs)
 {
-	int error = 0;
+	int error;
 	unsigned long addr = 0; /* Determine where the target instruction will send us to */
 
 	error = get_step_address(regs, &addr);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-04  2:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30  7:09 [PATCH] loongarch: kgdb: remove unnecessary init variable Li Jun
2025-06-03  1:20 ` Yanteng Si
2025-06-03  2:55   ` lijun
2025-06-03  3:30   ` lijun
2025-06-04  1:40     ` Yanteng Si
2025-06-04  2:57       ` Re:[PATCH] " lijun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).