[PATCH 2/2] checkpatch: Ignore networking block comment style first lines in file

From: Joe Perches
Date: Wed Feb 26 2014 - 14:39:13 EST


It's very common to have normal block comments for the initial
comments of a file description preface.

So for files in drivers/net and net/ don't emit a warning when
the first comment block in the file uses the normal block comment
style and not the networking block comment style.

Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
scripts/checkpatch.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ae9f71d..c624b04 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2219,7 +2219,8 @@ sub process {

if ($realfile =~ m@^(drivers/net/|net/)@ &&
$prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
- $rawline =~ /^\+[ \t]*\*/) {
+ $rawline =~ /^\+[ \t]*\*/ &&
+ $realline > 2) {
WARN("NETWORKING_BLOCK_COMMENT_STYLE",
"networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
}
--
1.8.1.2.459.gbcd45b4.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/