lkml.org 
[lkml]   [2014]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] net/dsa/dsa.c: remove null test before kfree
From
Date
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-06-21 16:21    [W:0.041 / U:10.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site