History

checkpatch: avoid some false positives for TABSTOP declaration test

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[]);

Joe Perches committed 8 years ago

Commit bd491111 parent a032aa41 file · +1 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+1−1
@@ -3020,7 +3020,7 @@ sub process { · 3019 unmodified lines
30203020
30213021 # check indentation starts on a tab stop
30223022 if ($^V && $^V ge 5.10.0 &&
3023− $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=\[])/) {
3023+ $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) {
30243024 my $indent = length($1);
30253025 if ($indent % 8) {
30263026 if (WARN("TABSTOP",