diff options
author | Joe Perches <joe@perches.com> | 2012-07-30 17:41:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:17 -0400 |
commit | ce0338df3c9a43e709b8a478265b32b9edcc7ccc (patch) | |
tree | 7f6c7047b4e1215f11ce2f774091237c7b5fdeb8 /scripts | |
parent | b34a26f3158cca932b6f1427b97fe12c7838ee68 (diff) |
checkpatch: test for non-standard signatures
Warn on non-standard signature styles.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 630319acb826..3e04f80375de 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1600,13 +1600,17 @@ sub process { | |||
1600 | 1600 | ||
1601 | # Check signature styles | 1601 | # Check signature styles |
1602 | if (!$in_header_lines && | 1602 | if (!$in_header_lines && |
1603 | $line =~ /^(\s*)($signature_tags)(\s*)(.*)/) { | 1603 | $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) { |
1604 | my $space_before = $1; | 1604 | my $space_before = $1; |
1605 | my $sign_off = $2; | 1605 | my $sign_off = $2; |
1606 | my $space_after = $3; | 1606 | my $space_after = $3; |
1607 | my $email = $4; | 1607 | my $email = $4; |
1608 | my $ucfirst_sign_off = ucfirst(lc($sign_off)); | 1608 | my $ucfirst_sign_off = ucfirst(lc($sign_off)); |
1609 | 1609 | ||
1610 | if ($sign_off !~ /$signature_tags/) { | ||
1611 | WARN("BAD_SIGN_OFF", | ||
1612 | "Non-standard signature: $sign_off\n" . $herecurr); | ||
1613 | } | ||
1610 | if (defined $space_before && $space_before ne "") { | 1614 | if (defined $space_before && $space_before ne "") { |
1611 | WARN("BAD_SIGN_OFF", | 1615 | WARN("BAD_SIGN_OFF", |
1612 | "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr); | 1616 | "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr); |