checkpatch: ignore networking block comment style first lines in file
authorJoe Perches <joe@perches.com>
Thu, 3 Apr 2014 21:49:20 +0000 (14:49 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 23:21:14 +0000 (16:21 -0700)
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@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index ae9f71d..c624b04 100755 (executable)
@@ -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);
                }