diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 42103a0cdbc0..c03e4278b07c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -443,7 +443,7 @@ sub seed_camelcase_file { | |||
443 | if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) { | 443 | if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) { |
444 | $camelcase{$1} = 1; | 444 | $camelcase{$1} = 1; |
445 | } | 445 | } |
446 | elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*\(/) { | 446 | elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) { |
447 | $camelcase{$1} = 1; | 447 | $camelcase{$1} = 1; |
448 | } | 448 | } |
449 | } | 449 | } |
@@ -1612,6 +1612,8 @@ sub process { | |||
1612 | my @setup_docs = (); | 1612 | my @setup_docs = (); |
1613 | my $setup_docs = 0; | 1613 | my $setup_docs = 0; |
1614 | 1614 | ||
1615 | my $camelcase_file_seeded = 0; | ||
1616 | |||
1615 | sanitise_line_reset(); | 1617 | sanitise_line_reset(); |
1616 | my $line; | 1618 | my $line; |
1617 | foreach my $rawline (@rawlines) { | 1619 | foreach my $rawline (@rawlines) { |
@@ -3394,7 +3396,13 @@ sub process { | |||
3394 | while ($var =~ m{($Ident)}g) { | 3396 | while ($var =~ m{($Ident)}g) { |
3395 | my $word = $1; | 3397 | my $word = $1; |
3396 | next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); | 3398 | next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); |
3397 | seed_camelcase_includes() if ($check); | 3399 | if ($check) { |
3400 | seed_camelcase_includes(); | ||
3401 | if (!$file && !$camelcase_file_seeded) { | ||
3402 | seed_camelcase_file($realfile); | ||
3403 | $camelcase_file_seeded = 1; | ||
3404 | } | ||
3405 | } | ||
3398 | if (!defined $camelcase{$word}) { | 3406 | if (!defined $camelcase{$word}) { |
3399 | $camelcase{$word} = 1; | 3407 | $camelcase{$word} = 1; |
3400 | CHK("CAMELCASE", | 3408 | CHK("CAMELCASE", |