projects/linux·commit ebf1bafd

LICENSES: Explicitly allow SPDX-FileCopyrightText

ebf1bafd · Krzysztof Kozlowski <[email protected]> · 2026-03-01 15:33:23 +01:00

Sources already have SPDX-FileCopyrightText (~40 instances) and more
appear on the mailing list, so document that it is allowed.  On the
other hand SPDX defines several other tags like SPDX-FileType, so add
checkpatch rule to narrow desired tags only to two of them - license and
copyright.  That way no new tags would sneak in to the kernel unnoticed.

Cc: Laurent Pinchart <[email protected]>
Cc: Joe Perches <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit
ebf1bafd090790704ba54c032de299fccd90a9da
Parents
f338e773

Changes

2 files changed · +13 −2

FileStatusAddDelContent
Documentation/process/license-rules.rstmodified+5−2View file
scripts/checkpatch.plmodified+8−0View file

Documentation/process/license-rules.rst

View file
diff --git a/Documentation/process/license-rules.rst b/Documentation/process/license-rules.rst
index 59a7832..b0176bb 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.
|

scripts/checkpatch.pl

View file
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e563746..2860f02 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3856,6 +3856,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: