Re: [PATCH] checkpatch: Add for_each tests to indentation and brace tests

From: Joe Perches
Date: Mon Jul 14 2014 - 04:18:57 EST


On Mon, 2014-07-14 at 09:13 +0100, Andy Whitcroft wrote:
> On Sat, Jul 12, 2014 at 10:33:54PM -0700, Joe Perches wrote:
> > All the various for_each loop macros were not tested for
> > trailing brace on the following lines and for bad indentation.
> >
> > Add them.
[]
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> > @@ -2698,7 +2698,7 @@ sub process {
> >
> > # if/while/etc brace do not go on next line, unless defining a do while loop,
> > # or if that brace on the next line is for something else
> > - if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
> > + if ($line =~ /(.*)\b((?:if|while|for|switch|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
>
> They way you end this first addition with |) converts it the (?:[a-z_]*)
> doesn't it? Were you intending to do (?:[a-z_]+_|) ?

I didn't think about it much.
It's the same thing no?


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