]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
LICENSES: Explicitly allow SPDX-FileCopyrightText
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Sun, 1 Mar 2026 14:33:23 +0000 (15:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2026 10:42:50 +0000 (11:42 +0100)
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 <laurent.pinchart@ideasonboard.com>
Cc: Joe Perches <joe@perches.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/process/license-rules.rst
scripts/checkpatch.pl

index 59a7832df7d08d817a4a179c9195b9ed7792aed1..b0176bb8a46535024ad41b625537254020fa50ea 100644 (file)
@@ -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.
 
 |
 
index e56374662ff7973abb2ecf01733ae8c32deccf18..2860f02a63e50ce663191270a85a49816b913901 100755 (executable)
@@ -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: