From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Whitcroft <apw@canonical.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 03/12] checkpatch: Warn when networking block comment lines don't start with *
Date: Mon, 10 Jun 2013 15:20:41 -0700 [thread overview]
Message-ID: <3abbc63b78a1eb970695f98a6239a1081a2cebb2.1370902448.git.joe@perches.com> (raw)
In-Reply-To: <cover.1370902448.git.joe@perches.com>
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.
Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a3922d0..576139a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1898,6 +1898,14 @@ sub process {
}
if ($realfile =~ m@^(drivers/net/|net/)@ &&
+ $prevrawline =~ /^\+[ \t]*\/\*/ && #starting /*
+ $prevrawline !~ /\*\/[ \t]*$/ && #no trailing */
+ $rawline !~ /^\+[ \t]*\*/) { #no leading *
+ WARN("NETWORKING_BLOCK_COMMENT_STYLE",
+ "networking block comments start with * on subsequent lines\n" . $hereprev);
+ }
+
+ if ($realfile =~ m@^(drivers/net/|net/)@ &&
$rawline !~ m@^\+[ \t]*\*/[ \t]*$@ && #trailing */
$rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/
$rawline !~ m@^\+.*\*{2,}/[ \t]*$@ && #trailing **/
--
1.8.1.2.459.gbcd45b4.dirty
next prev parent reply other threads:[~2013-06-10 22:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 22:20 [PATCH 00/12] checkpatch: collection of neatenings and new "--fix" Joe Perches
2013-06-10 22:20 ` [PATCH 01/12] checkpatch: Remove quote from CamelCase test Joe Perches
2013-06-10 22:20 ` [PATCH 02/12] checkpatch: Improve network block comment test and message Joe Perches
2013-06-10 22:20 ` Joe Perches [this message]
2013-06-10 22:20 ` [PATCH 04/12] checkpatch: Warn on comparisons to jiffies Joe Perches
2013-06-10 22:20 ` [PATCH 05/12] checkpatch: Warn on comparisons to get_jiffies_64() Joe Perches
2013-06-10 22:20 ` [PATCH 06/12] checkpatch: Reduce false positive rate of "complex macros" Joe Perches
2013-06-10 22:20 ` [PATCH 07/12] checkpatch: Add a placeholder to check blank lines before declarations Joe Perches
2013-06-10 22:20 ` [PATCH 08/12] checkpatch: Don't warn on blank lines before/after braces as often Joe Perches
2013-06-10 22:20 ` [PATCH 09/12] checkpatch: Add a --strict test for comparison to true/false Joe Perches
2013-06-10 22:20 ` [PATCH 10/12] checkpatch: Improve "no space after cast" test Joe Perches
2013-06-10 22:20 ` [PATCH 11/12] checkpatch: Create an EXPERIMENTAL --fix option to correct patches Joe Perches
2013-06-10 22:20 ` [PATCH 12/12] checkpatch: Move test for space before semicolon after operator spacing Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3abbc63b78a1eb970695f98a6239a1081a2cebb2.1370902448.git.joe@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®