Skip to content

Commit c70735c

Browse files
Łukasz Stelmachtorvalds
authored andcommitted
checkpatch: fix false positive on empty block comment lines
To avoid false positives in presence of SPDX-License-Identifier in networking files it is required to increase the leeway for empty block comment lines by one line. For example, checking drivers/net/loopback.c which starts with // SPDX-License-Identifier: GPL-2.0-or-later /* * INET An implementation of the TCP/IP protocol suite for the LINUX rsults in an unnecessary warning WARNING: networking block comments don't use an empty /* line, use /* Comment... +/* + * INET An implementation of the TCP/IP protocol suite for the LINUX Signed-off-by: Łukasz Stelmach <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: Bartłomiej Żolnierkiewicz <[email protected]> Cc: Marek Szyprowski <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2e44e80 commit c70735c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3464,7 +3464,7 @@ sub process {
34643464
if ($realfile =~ m@^(drivers/net/|net/)@ &&
34653465
$prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
34663466
$rawline =~ /^\+[ \t]*\*/ &&
3467-
$realline > 2) {
3467+
$realline > 3) { # Do not warn about the initial copyright comment block after SPDX-License-Identifier
34683468
WARN("NETWORKING_BLOCK_COMMENT_STYLE",
34693469
"networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
34703470
}

0 commit comments

Comments
 (0)