From: Joe Perches Date: Wed, 11 Sep 2013 21:23:57 +0000 (-0700) Subject: checkpatch: check for duplicate signatures X-Git-Tag: MMI-PSA29.97-13-9~13647^2~115 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e51f1979237e01bcd4e04e434c5da79151f08f8;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git checkpatch: check for duplicate signatures Emit a warning when a signature is used more than once. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c00e5108c0d2..7c79c91662c8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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. @@ -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