mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* checkpatch: Avoid some false positives for TABSTOP declaration test
@ 2018-01-11 21:01 Joe Perches
  0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2018-01-11 21:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Sven Eckelmann

Using an open bracket after what seems to be a declaration
can also be a function definition and declaration argument
line continuation so remove the open bracket from the
possible declaration/definition matching.

e.g.:
	int foobar(int a;
		   int *b[]);

Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Sven Eckelmann <sven@narfation.org>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d2464058ab5d..294f03fe25ea 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3020,7 +3020,7 @@ sub process {
 
 # check indentation starts on a tab stop
 		if ($^V && $^V ge 5.10.0 &&
-		    $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=\[])/) {
+		    $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) {
 			my $indent = length($1);
 			if ($indent % 8) {
 				if (WARN("TABSTOP",

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-11 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-11 21:01 checkpatch: Avoid some false positives for TABSTOP declaration test Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome