All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yanteng Si <si.yanteng@linux.dev>
To: lijun <lijun01@kylinos.cn>,
	chenhuacai@kernel.org, kernel@xen0n.name,
	loongarch@lists.linux.dev
Subject: Re: [PATCH] loongarch: kgdb: remove unnecessary init variable
Date: Wed, 4 Jun 2025 09:40:20 +0800	[thread overview]
Message-ID: <d18b3955-e57d-44df-b9da-5efd7f571d1a@linux.dev> (raw)
In-Reply-To: <137e7f072eebeb319188ddaead471074db7ba792.camel@kylinos.cn>

在 6/3/25 11:30 AM, lijun 写道:
> it is not a wrong, just look clean.

Alright, as you said, just for the clean. First, you deleted
one line and added another, so the number of code lines remains
unchanged, and the original line of code wasn't complicated to
begin with. Second, your patch only deletes two characters,
and I don't think this will significantly improve the code's 
readability. Finally, creating a patch for this consumes the
limited energy of reviewers and maintainers (many of whom are
working outside of regular working hours), and a lot of CI
infrastructure will consume electricity to test your patch.
It's not that I'm against your patch; I just want to know
if it's worth it?

BTW, We don't accept the top reply.


Thanks,
Yanteng
> 
> 
> 
> --------------------------
>> 在 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-04  1:40 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
2025-06-03  2:55   ` lijun
2025-06-03  3:30   ` lijun
2025-06-04  1:40     ` Yanteng Si [this message]
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=d18b3955-e57d-44df-b9da-5efd7f571d1a@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.