From: Andrew Morton <akpm@linux-foundation.org>
To: Joe Perches <joe@perches.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Andy Whitcroft <apw@canonical.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 1/2] checkpatch: Expand parenthesis alignment test to declarations, functions and assignments
Date: Mon, 31 Mar 2014 15:19:57 -0700 [thread overview]
Message-ID: <20140331151957.e4a856ced0f1446135376e74@linux-foundation.org> (raw)
In-Reply-To: <1396303838.21529.68.camel@joe-AO722>
On Mon, 31 Mar 2014 15:10:38 -0700 Joe Perches <joe@perches.com> wrote:
> On Mon, 2014-03-31 at 15:06 -0700, Andrew Morton wrote:
> > On Mon, 31 Mar 2014 14:58:07 -0700 Joe Perches <joe@perches.com> wrote:
> >
> > > Currently the parenthesis alignment test works only on
> > > misalignments of if statements like
> > >
> > > if (foo(bar,
> > > baz)
> > >
> > > Expand the test to find misalignments like:
> > >
> > > static inline int foo(int bar,
> > > int baz)
> > >
> > > and
> > >
> > > foo(bar,
> > > baz);
> > >
> > > and
> > >
> > > foo = bar(baz,
> > > qux);
> > >
> > > Expand the $Inline keyword for __inline and __inline__ too.
> > > Add $Inline to $Declare so it also matches "static inline <foo>".
> >
> > I'm having trouble understanding what this patch actually does. Some
> > little examples would be nice.
?
> > I typed in this to play with:
> >
> > void foo(int a,
> > int b)
> > {
> > }
> >
> > but I experienced playus interruptus
> >
> > akpm3:/usr/src/25> perl scripts/checkpatch.pl -f t.c
> > Global symbol "$c90_Keywords" requires explicit package name at scripts/checkpatch.pl line 2162.
> > Execution of scripts/checkpatch.pl aborted due to compilation errors.
> >
> > System is Ubuntu 12.04.4 (ish).
>
> You have to apply it to -next (your mm queue)
OK, the magic line was provided by
checkpatch-reduce-false-positives-for-missing-blank-line-after-declarations-test.patch,
which is marked "maybe merge, after I've played with it a bit". I'll move
that hunk into
checkpatch-expand-parenthesis-alignment-test-to-declarations-functions-and-assignments.patch
--- a/scripts/checkpatch.pl~checkpatch-expand-parenthesis-alignment-test-to-declarations-functions-and-assignments-fix
+++ a/scripts/checkpatch.pl
@@ -304,6 +304,8 @@ our $Operators = qr{
&&|\|\||,|\^|\+\+|--|&|\||$Arithmetic
}x;
+our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x;
+
our $NonptrType;
our $NonptrTypeWithAttr;
our $Type;
_
prev parent reply other threads:[~2014-03-31 22:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 21:58 Joe Perches
2014-03-31 21:58 ` [PATCH 2/2] checkpatch: Don't warn on bitfield spaces around : Joe Perches
2014-04-01 11:42 ` Dan Carpenter
2014-03-31 22:06 ` [PATCH V2 1/2] checkpatch: Expand parenthesis alignment test to declarations, functions and assignments Andrew Morton
2014-03-31 22:10 ` Joe Perches
2014-03-31 22:19 ` Andrew Morton [this message]
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=20140331151957.e4a856ced0f1446135376e74@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=dan.carpenter@oracle.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®