summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-07-23 21:29:06 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 10:47:26 -0700
commit7429c6903e3628fc2cfea65ec7e13bac030c7bfe (patch)
tree47f51d123e1e6d8b75a8e8337592638953252fe6 /scripts/checkpatch.pl
parent389a2fe57ffc59a649bea39db4d7e6d2eff2b562 (diff)
downloadlinux-stable-7429c6903e3628fc2cfea65ec7e13bac030c7bfe.tar.gz
linux-stable-7429c6903e3628fc2cfea65ec7e13bac030c7bfe.tar.bz2
linux-stable-7429c6903e3628fc2cfea65ec7e13bac030c7bfe.zip
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/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bcfb8ef00fee..077a2ca33043 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -17,7 +17,6 @@ my $quiet = 0;
my $tree = 1;
my $chk_signoff = 1;
my $chk_patch = 1;
-my $tst_type = 0;
my $tst_only;
my $emacs = 0;
my $terse = 0;
@@ -44,7 +43,6 @@ GetOptions(
'summary-file!' => \$summary_file,
'debug=s' => \%debug,
- 'test-type!' => \$tst_type,
'test-only=s' => \$tst_only,
) or exit;
@@ -67,6 +65,7 @@ if ($#ARGV < 0) {
my $dbg_values = 0;
my $dbg_possible = 0;
+my $dbg_type = 0;
for my $key (keys %debug) {
eval "\${dbg_$key} = '$debug{$key}';"
}
@@ -1307,8 +1306,12 @@ sub process {
if ($line=~/^[^\+]/) {next;}
# TEST: allow direct testing of the type matcher.
- if ($tst_type && $line =~ /^.$Declare$/) {
- ERROR("TEST: is type $Declare\n" . $herecurr);
+ if ($dbg_type) {
+ if ($line =~ /^.\s*$Declare\s*$/) {
+ ERROR("TEST: is type\n" . $herecurr);
+ } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) {
+ ERROR("TEST: is not type ($1 is)\n". $herecurr);
+ }
next;
}