RE: [PATCH] checkpatch: Add some --strict coding style checks

From: Allan, Bruce W
Date: Tue Feb 21 2012 - 21:17:53 EST


> -----Original Message-----
> From: Joe Perches [mailto:joe@xxxxxxxxxxx]
> Sent: Tuesday, February 21, 2012 5:59 PM
> To: Allan, Bruce W
> Cc: David Miller; Andy Whitcroft; Andrew Morton;
> andrei.emeltchenko.news@xxxxxxxxx; linville@xxxxxxxxxxxxx; linux-
> wireless@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: RE: [PATCH] checkpatch: Add some --strict coding style checks
>
> On Wed, 2012-02-22 at 01:56 +0000, Allan, Bruce W wrote:
> > > On Tue, 2012-02-21 at 22:09 +0000, Allan, Bruce W wrote:
> > > > This appears to falsely complain about parenthesis alignment in
> > > > conditional statements with multiple opening parentheses.
> > > Can you try this one please?
> []
> > It's better, but there are still instances of false hits AFAICT.
>
> Do you have any examples?
> The only one I noticed was spaces for alignment instead of tabs.
> I think that's not a false hit myself.
>

Example 1:
if (((a == b) ||
(c == d) ||
(e == f)) &&
(bool_var))
baz();

Example 2:
if ((!(var & FOO_MASK) &&
(a == b)) ||
(c == d))
baz();

Example 3:
if (!((foo & FOO_MASK) &&
(bar & BAR_MASK)))
baz();

HTH,
Bruce.
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i