[prev in list] [next in list] [prev in thread] [next in thread]
List: kernel-janitors
Subject: Re: [PATCH] fs/compat: remove redundant 'less than zero' check
From: Dan Carpenter <dan.carpenter () oracle ! com>
Date: 2015-04-24 13:00:29
Message-ID: 20150424130029.GD16501 () mwanda
[Download RAW message or body]
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic