Skip to content

Commit

Permalink
checkpatch: check for duplicate signatures
Browse files Browse the repository at this point in the history
Emit a warning when a signature is used more than once.

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>
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Sep 11, 2013
1 parent d62a201 commit 7e51f19
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,7 @@ sub process {
my %suppress_export;
my $suppress_statement = 0;

my %signatures = ();

# Pre-scan the patch sanitizing the lines.
# Pre-scan the patch looking for any __setup documentation.
Expand Down Expand Up @@ -1793,6 +1794,17 @@ sub process {
"email address '$email' might be better as '$suggested_email$comment'\n" . $herecurr);
}
}

# Check for duplicate signatures
my $sig_nospace = $line;
$sig_nospace =~ s/\s//g;
$sig_nospace = lc($sig_nospace);
if (defined $signatures{$sig_nospace}) {
WARN("BAD_SIGN_OFF",
"Duplicate signature\n" . $herecurr);
} else {
$signatures{$sig_nospace} = 1;
}
}

# Check for wrappage within a valid hunk of the file
Expand Down

0 comments on commit 7e51f19

Please sign in to comment.