aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <[email protected]>2020-10-15 20:12:25 -0700
committerLinus Torvalds <[email protected]>2020-10-16 11:11:21 -0700
commitc70735c23bf6cbfc9d7dad5f4ad562f0e40a89fa (patch)
tree1e543d1a4b95bb3a52016c25c243b7d3dfd67f83
parent2e44e8033a9bc0420f315c32843ab89c0fc7bd0f (diff)
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]>
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8a5f0367a2f1..e1ddcafdc176 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3464,7 +3464,7 @@ sub process {
if ($realfile =~ m@^(drivers/net/|net/)@ &&
$prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
$rawline =~ /^\+[ \t]*\*/ &&
- $realline > 2) {
+ $realline > 3) { # Do not warn about the initial copyright comment block after SPDX-License-Identifier
WARN("NETWORKING_BLOCK_COMMENT_STYLE",
"networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
}