Skip to content

Commit 7e51f19

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: check for duplicate signatures
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>
1 parent d62a201 commit 7e51f19

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎scripts/checkpatch.pl‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,7 @@ sub process {
15441544
my %suppress_export;
15451545
my $suppress_statement = 0;
15461546

1547+
my %signatures = ();
15471548

15481549
# Pre-scan the patch sanitizing the lines.
15491550
# Pre-scan the patch looking for any __setup documentation.
@@ -1793,6 +1794,17 @@ sub process {
17931794
"email address '$email' might be better as '$suggested_email$comment'\n" . $herecurr);
17941795
}
17951796
}
1797+
1798+
# Check for duplicate signatures
1799+
my $sig_nospace = $line;
1800+
$sig_nospace =~ s/\s//g;
1801+
$sig_nospace = lc($sig_nospace);
1802+
if (defined $signatures{$sig_nospace}) {
1803+
WARN("BAD_SIGN_OFF",
1804+
"Duplicate signature\n" . $herecurr);
1805+
} else {
1806+
$signatures{$sig_nospace} = 1;
1807+
}
17961808
}
17971809

17981810
# Check for wrappage within a valid hunk of the file

0 commit comments

Comments
 (0)