History

checkpatch: warn when networking block comment lines don't start with *

Some block comments in network are written as: /* block comment line 1 block comment line 2 */ Emit a warning on the "block comment line 2" because it should be /* block comment line 1 * block comment line 2 */ This warning is only emitted on the second line of a block comment.

Joe Perches committed 13 years ago

Commit a605e321 parent fdb4bcd1 file · +8 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+8−0
@@ -1897,6 +1897,14 @@ sub process { · 1896 unmodified lines
1897 "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);1897 "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
1898 }1898 }
1899 1899
1900 if ($realfile =~ m@^(drivers/net/|net/)@ &&
1901 $prevrawline =~ /^\+[ \t]*\/\*/ && #starting /*
1902 $prevrawline !~ /\*\/[ \t]*$/ && #no trailing */
1903 $rawline !~ /^\+[ \t]*\*/) { #no leading *
1904 WARN("NETWORKING_BLOCK_COMMENT_STYLE",
1905 "networking block comments start with * on subsequent lines\n" . $hereprev);
1906 }
1907
1900 if ($realfile =~ m@^(drivers/net/|net/)@ &&1908 if ($realfile =~ m@^(drivers/net/|net/)@ &&
1901 $rawline !~ m@^\+[ \t]*\*/[ \t]*$@ && #trailing */1909 $rawline !~ m@^\+[ \t]*\*/[ \t]*$@ && #trailing */
1902 $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/1910 $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/