aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2018-08-22 00:58:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-22 13:52:48 -0400
commit490b292c834c5e72057f4315ef915692cbd6defd (patch)
tree2496c8136da8dcb065f3825722cbac3a15ac4bfe /scripts
parent60f890105547f7a48ea1d67c5ae69966c7245b23 (diff)
checkpatch: warn when a patch doesn't have a description
Potential patches should have a commit description. Emit a warning when there isn't one. [akpm@linux-foundation.org: s/else if/elsif/] Link: http://lkml.kernel.org/r/1b099f4d8373aa583a17011992676bf0f3f09eee.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Suggested-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b5eade941f4a..25adf9811a2c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2253,6 +2253,7 @@ sub process {
2253 my $in_header_lines = $file ? 0 : 1; 2253 my $in_header_lines = $file ? 0 : 1;
2254 my $in_commit_log = 0; #Scanning lines before patch 2254 my $in_commit_log = 0; #Scanning lines before patch
2255 my $has_commit_log = 0; #Encountered lines before patch 2255 my $has_commit_log = 0; #Encountered lines before patch
2256 my $commit_log_lines = 0; #Number of commit log lines
2256 my $commit_log_possible_stack_dump = 0; 2257 my $commit_log_possible_stack_dump = 0;
2257 my $commit_log_long_line = 0; 2258 my $commit_log_long_line = 0;
2258 my $commit_log_has_diff = 0; 2259 my $commit_log_has_diff = 0;
@@ -2510,6 +2511,18 @@ sub process {
2510 2511
2511 $cnt_lines++ if ($realcnt != 0); 2512 $cnt_lines++ if ($realcnt != 0);
2512 2513
2514# Verify the existence of a commit log if appropriate
2515# 2 is used because a $signature is counted in $commit_log_lines
2516 if ($in_commit_log) {
2517 if ($line !~ /^\s*$/) {
2518 $commit_log_lines++; #could be a $signature
2519 }
2520 } elsif ($has_commit_log && $commit_log_lines < 2) {
2521 WARN("COMMIT_MESSAGE",
2522 "Missing commit description - Add an appropriate one\n");
2523 $commit_log_lines = 2; #warn only once
2524 }
2525
2513# Check if the commit log has what seems like a diff which can confuse patch 2526# Check if the commit log has what seems like a diff which can confuse patch
2514 if ($in_commit_log && !$commit_log_has_diff && 2527 if ($in_commit_log && !$commit_log_has_diff &&
2515 (($line =~ m@^\s+diff\b.*a/[\w/]+@ && 2528 (($line =~ m@^\s+diff\b.*a/[\w/]+@ &&