History

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

Łukasz Stelmach committed 6 years ago

Commit c70735c1 parent 2e44e801 file · +1 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+1−1
@@ -3464,7 +3464,7 @@ sub process { · 3463 unmodified lines
3464 if ($realfile =~ m@^(drivers/net/|net/)@ &&3464 if ($realfile =~ m@^(drivers/net/|net/)@ &&
3465 $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&3465 $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
3466 $rawline =~ /^\+[ \t]*\*/ &&3466 $rawline =~ /^\+[ \t]*\*/ &&
3467 $realline > 2) {3467 $realline > 3) { # Do not warn about the initial copyright comment block after SPDX-License-Identifier
3468 WARN("NETWORKING_BLOCK_COMMENT_STYLE",3468 WARN("NETWORKING_BLOCK_COMMENT_STYLE",
3469 "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);3469 "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
3470 }3470 }