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

Julia Lawall
2015-04-24T12:23:23Z

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?

julia

>
> 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
>