Netdev List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: "Bjørn Mork" <bjorn@mork.no>,
	linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Grant Likely" <grant.likely@linaro.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net/dsa/dsa.c: remove null test before kfree
Date: Sat, 21 Jun 2014 07:10:06 -0700	[thread overview]
Message-ID: <1403359806.4076.50.camel@joe-AO725> (raw)
In-Reply-To: <20140621113653.6b2dd148b35a6ecfb7c08cce@skynet.be>

On Sat, 2014-06-21 at 11:36 +0200, Fabian Frederick wrote:
> On Sat, 21 Jun 2014 10:37:24 +0200 Bjørn Mork <bjorn@mork.no> wrote:
> > On 20 June 2014 22:36:47 CEST, Fabian Frederick <fabf@skynet.be> wrote:
> > > Fix checkpatch warning:
> > > WARNING: kfree(NULL) is safe this check is probably not required
> > 
> > "probably not" implies that there are cases where the check *is*
> > required.  That means that your commit message should explain why
> > this particular check is redundant.
> > 
> > I haven't analyzed your changes here, so they could be fine for all
> > I know. My point is that such analysis is your job when submitting
> > cleanups like this one.
> AFAIK, any
> 
> if(foo)
> 	kfree(foo)
> 	
> can be updated to kfree(foo) but
> 
> if (foo){
> 	kfree(foo)
> 	do something else
> }
> 
> has to be evaluated ; reason for the "probably" in warning message.
> If I'm wrong maybe we could be more verbose in checkpatch :)

I think Bjørn is correct here.

Just because checkpatch bleats some message or another,
it's still the submitter's job to validate the code.

In this case, it seems the simple substitution of
"unnecessary null" to the subject would have been
enough validation.

I don't think checkpatch needs updating for this, but
maybe you could propose better language.

  reply	other threads:[~2014-06-21 14:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 20:36 [PATCH 1/1] net/dsa/dsa.c: remove null test before kfree Fabian Frederick
2014-06-21  8:37 ` Bjørn Mork
2014-06-21  9:36   ` Fabian Frederick
2014-06-21 14:10     ` Joe Perches [this message]
2014-06-22  2:22       ` David Miller

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=1403359806.4076.50.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=fabf@skynet.be \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --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