diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f7f222a1e908..e46414dce05f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -423,6 +423,7 @@ our @typeList = ( | |||
| 423 | qr{${Ident}_handler_fn}, | 423 | qr{${Ident}_handler_fn}, |
| 424 | @typeListMisordered, | 424 | @typeListMisordered, |
| 425 | ); | 425 | ); |
| 426 | our @typeListFile = (); | ||
| 426 | our @typeListWithAttr = ( | 427 | our @typeListWithAttr = ( |
| 427 | @typeList, | 428 | @typeList, |
| 428 | qr{struct\s+$InitAttribute\s+$Ident}, | 429 | qr{struct\s+$InitAttribute\s+$Ident}, |
| @@ -432,6 +433,7 @@ our @typeListWithAttr = ( | |||
| 432 | our @modifierList = ( | 433 | our @modifierList = ( |
| 433 | qr{fastcall}, | 434 | qr{fastcall}, |
| 434 | ); | 435 | ); |
| 436 | our @modifierListFile = (); | ||
| 435 | 437 | ||
| 436 | our @mode_permission_funcs = ( | 438 | our @mode_permission_funcs = ( |
| 437 | ["module_param", 3], | 439 | ["module_param", 3], |
| @@ -515,8 +517,8 @@ if ($codespell) { | |||
| 515 | $misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix; | 517 | $misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix; |
| 516 | 518 | ||
| 517 | sub build_types { | 519 | sub build_types { |
| 518 | my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; | 520 | my $mods = "(?x: \n" . join("|\n ", (@modifierList, @modifierListFile)) . "\n)"; |
| 519 | my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; | 521 | my $all = "(?x: \n" . join("|\n ", (@typeList, @typeListFile)) . "\n)"; |
| 520 | my $Misordered = "(?x: \n" . join("|\n ", @typeListMisordered) . "\n)"; | 522 | my $Misordered = "(?x: \n" . join("|\n ", @typeListMisordered) . "\n)"; |
| 521 | my $allWithAttr = "(?x: \n" . join("|\n ", @typeListWithAttr) . "\n)"; | 523 | my $allWithAttr = "(?x: \n" . join("|\n ", @typeListWithAttr) . "\n)"; |
| 522 | $Modifier = qr{(?:$Attribute|$Sparse|$mods)}; | 524 | $Modifier = qr{(?:$Attribute|$Sparse|$mods)}; |
| @@ -748,6 +750,9 @@ for my $filename (@ARGV) { | |||
| 748 | @fixed_inserted = (); | 750 | @fixed_inserted = (); |
| 749 | @fixed_deleted = (); | 751 | @fixed_deleted = (); |
| 750 | $fixlinenr = -1; | 752 | $fixlinenr = -1; |
| 753 | @modifierListFile = (); | ||
| 754 | @typeListFile = (); | ||
| 755 | build_types(); | ||
| 751 | } | 756 | } |
| 752 | 757 | ||
| 753 | exit($exit); | 758 | exit($exit); |
| @@ -1612,13 +1617,13 @@ sub possible { | |||
| 1612 | for my $modifier (split(' ', $possible)) { | 1617 | for my $modifier (split(' ', $possible)) { |
| 1613 | if ($modifier !~ $notPermitted) { | 1618 | if ($modifier !~ $notPermitted) { |
| 1614 | warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); | 1619 | warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); |
| 1615 | push(@modifierList, $modifier); | 1620 | push(@modifierListFile, $modifier); |
| 1616 | } | 1621 | } |
| 1617 | } | 1622 | } |
| 1618 | 1623 | ||
| 1619 | } else { | 1624 | } else { |
| 1620 | warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible); | 1625 | warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible); |
| 1621 | push(@typeList, $possible); | 1626 | push(@typeListFile, $possible); |
| 1622 | } | 1627 | } |
| 1623 | build_types(); | 1628 | build_types(); |
| 1624 | } else { | 1629 | } else { |
