Re: [PATCH] fs/compat: remove redundant 'less than zero' check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 24, 2015 at 02:23:23PM +0200, Julia Lawall wrote:
> On Fri, 24 Apr 2015, Dan Carpenter wrote:
> 
> > On Fri, Apr 24, 2015 at 06:07:50PM +0800, Firo Yang wrote:
> >
> > > -	if (nr_segs > UIO_MAXIOV || nr_segs < 0)
> > > +	if (nr_segs > UIO_MAXIOV)
> >
> > Linus said at kernel summit that he thinks this kind of checks are ok.
> >
> > Smatch already ignores checks like:
> >
> > 	if (nr_segs < 0 || nr_segs > UIO_MAXIOV)
> >
> > So making it ignore this one as well shouldn't be hard...  I'll change
> > Smatch to ignore this one as well.
> 
> It is unsigned.  What is the point of cluttering the code?

I guess I don't feel strongly either way.  It was Linus who said
something like "the intent is clear from the code" so he isn't a fan of
these particular static checker fixes.

These are easy enough for me to filter out so they needn't cause a false
positive.

They're more of a style issue than anything else.  With coccinelle, it's
easier to care about style issues because you can fix them automatically.
In Smatch caring about style issues is a time suck.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux