aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2019-03-07 19:28:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-07 21:32:01 -0500
commita8da38a9cf0e9889a6334bbd6e7364307b571cc1 (patch)
tree471bd9eb3cd22f212549fc983c3a83f8894dfdb0 /scripts
parent98005e8c743f9a5ef3a0e6c971d424da118bd07e (diff)
checkpatch: add test for SPDX-License-Identifier on wrong line #
Warn when any SPDX-License-Identifier: tag is not created on the proper line number. Link: http://lkml.kernel.org/r/9b74ee87f8c1b8fd310e213fcb4994d58610fcb6.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: "Enrico Weigelt, metux IT consult" <lkml@metux.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index cbbeb3830a48..8d8d26b5cbbd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3073,6 +3073,14 @@ sub process {
3073# check we are in a valid source file if not then ignore this hunk 3073# check we are in a valid source file if not then ignore this hunk
3074 next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); 3074 next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/);
3075 3075
3076# check for using SPDX-License-Identifier on the wrong line number
3077 if ($realline != $checklicenseline &&
3078 $rawline =~ /\bSPDX-License-Identifier:/ &&
3079 substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) {
3080 WARN("SPDX_LICENSE_TAG",
3081 "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr);
3082 }
3083
3076# line length limit (with some exclusions) 3084# line length limit (with some exclusions)
3077# 3085#
3078# There are a few types of lines that may extend beyond $max_line_length: 3086# There are a few types of lines that may extend beyond $max_line_length: