aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-07-24 00:29:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:26 -0400
commit7429c6903e3628fc2cfea65ec7e13bac030c7bfe (patch)
tree47f51d123e1e6d8b75a8e8337592638953252fe6 /scripts
parent389a2fe57ffc59a649bea39db4d7e6d2eff2b562 (diff)
checkpatch: improve type matcher debug
Improve type matcher debug so we can see what it does match. As part of this move us to to using the common debug framework. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bcfb8ef00fe..077a2ca3304 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -17,7 +17,6 @@ my $quiet = 0;
17my $tree = 1; 17my $tree = 1;
18my $chk_signoff = 1; 18my $chk_signoff = 1;
19my $chk_patch = 1; 19my $chk_patch = 1;
20my $tst_type = 0;
21my $tst_only; 20my $tst_only;
22my $emacs = 0; 21my $emacs = 0;
23my $terse = 0; 22my $terse = 0;
@@ -44,7 +43,6 @@ GetOptions(
44 'summary-file!' => \$summary_file, 43 'summary-file!' => \$summary_file,
45 44
46 'debug=s' => \%debug, 45 'debug=s' => \%debug,
47 'test-type!' => \$tst_type,
48 'test-only=s' => \$tst_only, 46 'test-only=s' => \$tst_only,
49) or exit; 47) or exit;
50 48
@@ -67,6 +65,7 @@ if ($#ARGV < 0) {
67 65
68my $dbg_values = 0; 66my $dbg_values = 0;
69my $dbg_possible = 0; 67my $dbg_possible = 0;
68my $dbg_type = 0;
70for my $key (keys %debug) { 69for my $key (keys %debug) {
71 eval "\${dbg_$key} = '$debug{$key}';" 70 eval "\${dbg_$key} = '$debug{$key}';"
72} 71}
@@ -1307,8 +1306,12 @@ sub process {
1307 if ($line=~/^[^\+]/) {next;} 1306 if ($line=~/^[^\+]/) {next;}
1308 1307
1309# TEST: allow direct testing of the type matcher. 1308# TEST: allow direct testing of the type matcher.
1310 if ($tst_type && $line =~ /^.$Declare$/) { 1309 if ($dbg_type) {
1311 ERROR("TEST: is type $Declare\n" . $herecurr); 1310 if ($line =~ /^.\s*$Declare\s*$/) {
1311 ERROR("TEST: is type\n" . $herecurr);
1312 } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) {
1313 ERROR("TEST: is not type ($1 is)\n". $herecurr);
1314 }
1312 next; 1315 next;
1313 } 1316 }
1314 1317