[PATCH] scripts/checkpatch.pl: Add warning about leadingcontination tests

From: Joe Perches
Date: Sat Dec 05 2009 - 12:58:11 EST


Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>

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.*/ &&


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