]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - scripts/checkpatch.pl
checkpatch: update signature "might be better as" warning
[karo-tx-linux.git] / scripts / checkpatch.pl
index 8fda3b3f7be87c01958c80823aea23cc22c790bf..885e3b43d64af21de23f9c4f574a09dbe8326392 100755 (executable)
@@ -1504,9 +1504,11 @@ sub process {
                if ($line =~ /^diff --git.*?(\S+)$/) {
                        $realfile = $1;
                        $realfile =~ s@^([^/]*)/@@;
+                       $in_commit_log = 0;
                } elsif ($line =~ /^\+\+\+\s+(\S+)/) {
                        $realfile = $1;
                        $realfile =~ s@^([^/]*)/@@;
+                       $in_commit_log = 0;
 
                        $p1_prefix = $1;
                        if (!$file && $tree && $p1_prefix ne '' &&
@@ -1546,7 +1548,8 @@ sub process {
                }
 
 # Check signature styles
-               if ($line =~ /^(\s*)($signature_tags)(\s*)(.*)/) {
+               if (!$in_header_lines &&
+                   $line =~ /^(\s*)($signature_tags)(\s*)(.*)/) {
                        my $space_before = $1;
                        my $sign_off = $2;
                        my $space_after = $3;
@@ -1623,7 +1626,7 @@ sub process {
 # Check if it's the start of a commit log
 # (not a header line and we haven't seen the patch filename)
                if ($in_header_lines && $realfile =~ /^$/ &&
-                   $rawline !~ /^(commit\b|from\b|\w+:).+$/i) {
+                   $rawline !~ /^(commit\b|from\b|[\w-]+:).+$/i) {
                        $in_header_lines = 0;
                        $in_commit_log = 1;
                }