summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/process/license-rules.rst7
-rwxr-xr-xscripts/checkpatch.pl8
2 files changed, 13 insertions, 2 deletions
diff --git a/Documentation/process/license-rules.rst b/Documentation/process/license-rules.rst
index 59a7832df7d0..b0176bb8a465 100644
--- a/Documentation/process/license-rules.rst
+++ b/Documentation/process/license-rules.rst
@@ -63,8 +63,11 @@ License identifier syntax
The SPDX license identifier in kernel files shall be added at the first
possible line in a file which can contain a comment. For the majority
of files this is the first line, except for scripts which require the
- '#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX
- identifier goes into the second line.
+ '#!PATH_TO_INTERPRETER' in the first line. For those scripts, the SPDX
+ license identifier goes into the second line.
+
+ The license identifier line can then be followed by one or multiple
+ SPDX-FileCopyrightText lines if desired.
|
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1eff43fd8f95..0492d6afc9a1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3866,6 +3866,14 @@ sub process {
"Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr);
}
+# check for disallowed SPDX file tags
+ if ($rawline =~ /\bSPDX-.*:/ &&
+ $rawline !~ /\bSPDX-License-Identifier:/ &&
+ $rawline !~ /\bSPDX-FileCopyrightText:/) {
+ WARN("SPDX_LICENSE_TAG",
+ "Disallowed SPDX tag\n" . $herecurr);
+ }
+
# line length limit (with some exclusions)
#
# There are a few types of lines that may extend beyond $max_line_length: