Re: [PATCH] checkpatch: Suggest using min_t or max_t

From: Andrew Morton
Date: Wed May 25 2011 - 19:54:23 EST


On Tue, 24 May 2011 17:11:13 -0700
Joe Perches <joe@xxxxxxxxxxx> wrote:

> On Tue, 2011-05-24 at 16:35 -0700, Andrew Morton wrote:
> > On Fri, 20 May 2011 13:24:48 -0700
> > Joe Perches <joe@xxxxxxxxxxx> wrote:
> >
> > > A common issue with min() or max() is using a cast on
> > > one or both of the arguments when using min_t/max_t could
> > > be better.
> > >
> > > Add cast detection to uses of min/max and suggest an
> > > appropriate use of min_t or max_t instead.
> >
> > Causes this:
> >
> > akpm2:/usr/src/25> perl scripts/checkpatch.pl patches/drivers-gpio-vx855_gpioc-needs-slabh.patch
> > Nested quantifiers in regex; marked by <-- HERE in m/(\((?:[^\(\)]++ <-- HERE |(?-1))*\))/ at scripts/checkpatch.pl line 271.
>
> Something not making sense here.
> I get no report when I try your patch.
> (using checkpatch with the regex I sent)
>
> Send the patch again?
>
> $ perl --version
>
> This is perl, v5.10.1 (*) built for i686-linux-gnu-thread-multi
> (with 53 registered patches, see perl -V for more detail)
>

It happens with perl v5.8.8:

akpm2:/usr/src/25> perl scripts/checkpatch.pl this-file-does-not-exist
Nested quantifiers in regex; marked by <-- HERE in m/(\((?:[^\(\)]++ <-- HERE |(?-1))*\))/ at scripts/checkpatch.pl line 271.



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