lkml.org 
[lkml]   [2009]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] scripts/checkpatch.pl: Add warning about leading contination tests
On Sun, 06 Dec 2009 09:35:04 +0100, Eric Dumazet wrote:
> Joe Perches a écrit :
> > Signed-off-by: Joe Perches <joe@perches.com>
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index bc4114f..c35933a 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -2064,6 +2064,11 @@ sub process {
> > CHK("multiple assignments should be avoided\n" . $herecurr);
> > }
> >
> > +# Check use of leading logical continuation tests
> > + if ($line =~ /^.\s*(\|\||&&)/) {
> > + WARN("Continuation logic should be at end of previous line\n" . $herecurr);
> > + }
> > +
> > ## # check for multiple declarations, allowing for a function declaration
> > ## # continuation.
> > ## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
> >
> >
>
> Fine with me, but please add relevant info in Documentation/CodingStyle ?

Not fine with me. Placing the binary logic operator at the beginning
of a line can be a deliberate choice, either to make complex binary
expressions more readable, or to avoid long lines. I don't see much
point in banning this style, which BTW is used over 8000 times in the
current kernel tree.

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

\
 
 \ /
  Last update: 2009-12-06 13:15    [W:0.070 / U:15.504 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site