From: Dan Carpenter <dan.carpenter@oracle.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Firo Yang <firogm@gmail.com>,
viro@zeniv.linux.org.uk, kernel-janitors@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs/compat: remove redundant 'less than zero' check
Date: Fri, 24 Apr 2015 13:00:29 +0000 [thread overview]
Message-ID: <20150424130029.GD16501@mwanda> (raw)
In-Reply-To: <alpine.DEB.2.10.1504241423060.2949@hadrien>
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
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Firo Yang <firogm@gmail.com>,
viro@zeniv.linux.org.uk, kernel-janitors@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs/compat: remove redundant 'less than zero' check
Date: Fri, 24 Apr 2015 16:00:29 +0300 [thread overview]
Message-ID: <20150424130029.GD16501@mwanda> (raw)
In-Reply-To: <alpine.DEB.2.10.1504241423060.2949@hadrien>
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
next prev parent reply other threads:[~2015-04-24 13:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 10:07 [PATCH] fs/compat: remove redundant 'less than zero' check Firo Yang
2015-04-24 10:07 ` Firo Yang
2015-04-24 10:10 ` Julia Lawall
2015-04-24 10:10 ` Julia Lawall
[not found] ` <CAOXNuu2VKCWNSiePoSw4-G3TqxpXDE9fR75B75-fhQLa-SPcJg@mail.gmail.com>
2015-04-24 10:29 ` Julia Lawall
2015-04-24 10:29 ` Julia Lawall
2015-04-24 12:04 ` Dan Carpenter
2015-04-24 12:04 ` Dan Carpenter
2015-04-24 12:23 ` Julia Lawall
2015-04-24 12:23 ` Julia Lawall
2015-04-24 13:00 ` Dan Carpenter [this message]
2015-04-24 13:00 ` 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=20150424130029.GD16501@mwanda \
--to=dan.carpenter@oracle.com \
--cc=firogm@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.