All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yanteng Si <si.yanteng@linux.dev>
To: Li Jun <lijun01@kylinos.cn>,
	chenhuacai@kernel.org, kernel@xen0n.name,
	loongarch@lists.linux.dev
Subject: Re: [PATCH] loongarch: kgdb: remove unnecessary init variable
Date: Tue, 3 Jun 2025 09:20:00 +0800	[thread overview]
Message-ID: <8bcf144a-398e-4d78-8848-624502e7a85d@linux.dev> (raw)
In-Reply-To: <20250530070902.410248-1-lijun01@kylinos.cn>

在 5/30/25 3:09 PM, Li Jun 写道:
> 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.
So, is it wrong to initialize it to 0 now?


Thanks,
Yanteng
> 
> 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);


  reply	other threads:[~2025-06-03  1:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30  7:09 [PATCH] loongarch: kgdb: remove unnecessary init variable Li Jun
2025-06-03  1:20 ` Yanteng Si [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bcf144a-398e-4d78-8848-624502e7a85d@linux.dev \
    --to=si.yanteng@linux.dev \
    --cc=chenhuacai@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=lijun01@kylinos.cn \
    --cc=loongarch@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.