Commit 61135e96 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: fix networking kernel-doc block comment defect



checkpatch can generate a false positive when inserting a new kernel-doc
block and function above an existing kernel-doc block.

Fix it by checking that the context line is also a newly inserted line.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reported-by: default avatarDarren Hart <dvhart@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 70dc8a48
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2086,6 +2086,7 @@ sub process {
		if ($realfile =~ m@^(drivers/net/|net/)@ &&
		    $prevrawline =~ /^\+[ \t]*\/\*/ &&		#starting /*
		    $prevrawline !~ /\*\/[ \t]*$/ &&		#no trailing */
		    $rawline =~ /^\+/ &&			#line is new
		    $rawline !~ /^\+[ \t]*\*/) {		#no leading *
			WARN("NETWORKING_BLOCK_COMMENT_STYLE",
			     "networking block comments start with * on subsequent lines\n" . $hereprev);