public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: maowenan <maowenan@huawei.com>
Cc: kernel-janitors@vger.kernel.org, netdev@vger.kernel.org,
	john.fastabend@gmail.com, hawk@kernel.org,
	jakub.kicinski@netronome.com, daniel@iogearbox.net,
	ast@kernel.org
Subject: Re: [PATCH] net: ns83820: drop pointless static qualifier in ns83820_probe_phy()
Date: Tue, 19 Feb 2019 08:15:26 +0000	[thread overview]
Message-ID: <alpine.DEB.2.21.1902190914000.2570@hadrien> (raw)
In-Reply-To: <578c4208-956d-b905-6a50-5ad04620a349@huawei.com>



On Tue, 19 Feb 2019, maowenan wrote:

>
>
> On 2019/2/19 16:01, Julia Lawall wrote:
> >
> >
> > On Tue, 19 Feb 2019, Mao Wenan wrote:
> >
> >> There is no need to have the 'int first' static
> >> since new value always be assigned before use it.
> >> The old codes of first dereferencing this variable have
> >> been commented out. So it is useless with 'static int first'.
> >> /*
> >> if (!first) {
> >>  ...
> >> }
> >> */
> >> first = 1;
> >
> > Do you need the variable at all?
> >
> > In the code, the commenting out is actually done with #if 0.  It could be
> > good for the commit log to reflect the code more accurately.
> >
> OK, the original codes are using #if 0 to comment out, but when I generate patch
> the "#if 0" has been removed, so I use "/*...*/" to reflect that.

I don't understand the above comment.  The proposed patch doesn't have any
impact on the #if 0 lines.

>
> > Can the #if 0 and code be removed?  Apparently it predates git.
> >
> > A commented out printk below also predates git.
> >
> I think all the "#if 0" comment out codes and printk codes can be removed, shall I send
> v2 to do this?

It seems reasonable to me.

julia

> > julia
> >
> >>
> >> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> >> ---
> >>  drivers/net/ethernet/natsemi/ns83820.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
> >> index 958fced4dacf..fb064df3a1a6 100644
> >> --- a/drivers/net/ethernet/natsemi/ns83820.c
> >> +++ b/drivers/net/ethernet/natsemi/ns83820.c
> >> @@ -1869,7 +1869,7 @@ static unsigned ns83820_mii_write_reg(struct ns83820 *dev, unsigned phy, unsigne
> >>  static void ns83820_probe_phy(struct net_device *ndev)
> >>  {
> >>  	struct ns83820 *dev = PRIV(ndev);
> >> -	static int first;
> >> +	int first;
> >>  	int i;
> >>  #define MII_PHYIDR1	0x02
> >>  #define MII_PHYIDR2	0x03
> >> --
> >> 2.20.1
> >>
> >>
> >
> > .
> >
>
>

  reply	other threads:[~2019-02-19  8:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19  7:53 [PATCH] net: ns83820: drop pointless static qualifier in ns83820_probe_phy() Mao Wenan
2019-02-19  8:01 ` Julia Lawall
2019-02-19  8:09   ` maowenan
2019-02-19  8:15     ` Julia Lawall [this message]
2019-02-19 14:21 ` Dan Carpenter

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=alpine.DEB.2.21.1902190914000.2570@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hawk@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=maowenan@huawei.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox