Skip to contentSkip to conversation

checkpatch-test-multiple-line-block-comment-alignment.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 12, 2016

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: checkpatch: test multiple line block comment alignment
has been removed from the -mm tree. Its filename was
checkpatch-test-multiple-line-block-comment-alignment.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Joe Perches <[email protected]>
Subject: checkpatch: test multiple line block comment alignment

Warn when block comments are not aligned on the *

/*
* block comment, no warning
*/

/*
* block comment, emit warning
*/

---

 scripts/checkpatch.pl |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-test-multiple-line-block-comment-alignment +19 -0
diff -puN scripts/checkpatch.pl~checkpatch-test-multiple-line-block-comment-alignment scripts/checkpatch.pl
@@ -2979,6 +2979,25 @@ sub process {
 			     "Block comments use a trailing */ on a separate line\n" . $herecurr);
 		}
 
+# Block comment * alignment
+		if ($prevline =~ /$;[ \t]*$/ &&			#ends in comment
+		    (($prevrawline =~ /^\+.*?\/\*/ &&		#starting /*
+		      $prevrawline !~ /\*\/[ \t]*$/) ||		#no trailing */
+		     $prevrawline =~ /^\+[ \t]*\*/) &&		#starting *
+		    $rawline =~ /^\+[ \t]*\*/) {		#rawline *
+			$prevrawline =~ m@^\+([ \t]*/?)\*@;
+			my $oldindent = expand_tabs($1);
+			$rawline =~ m@^\+([ \t]*)\*@;
+			my $newindent = $1;
+			my $test_comment = '^\\+' . "$;" x (length($newindent) + 1);
+			$newindent = expand_tabs($newindent);
+			if ($line =~ /$test_comment/ &&
+			    length($oldindent) ne length($newindent)) {
+				WARN("BLOCK_COMMENT_STYLE",
+				     "Block comments should align the * on each line\n" . $hereprev);
+			}
+		}
+
 # check for missing blank lines after struct/union declarations
 # with exceptions for various attributes and macros
 		if ($prevline =~ /^[\+ ]};?\s*$/ &&

_

Patches currently in -mm which might be from [email protected] are