History

LICENSES: Explicitly allow SPDX-FileCopyrightText

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.

Krzysztof Kozlowski committed 8 months ago

Commit ebf1baf1 parent f338e772 files · +13 −2Browse files

Unified · Split

2 files
  1. Documentation/process/license-rules.rst +5 −2
  2. scripts/checkpatch.pl +8 −0
Documentation/process/license-rules.rst+5−2
@@ -63,8 +63,11 @@ License identifier syntax · 62 unmodified lines
63 The SPDX license identifier in kernel files shall be added at the first63 The SPDX license identifier in kernel files shall be added at the first
64 possible line in a file which can contain a comment. For the majority64 possible line in a file which can contain a comment. For the majority
65 of files this is the first line, except for scripts which require the65 of files this is the first line, except for scripts which require the
66 '#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX66 '#!PATH_TO_INTERPRETER' in the first line. For those scripts, the SPDX
67 identifier goes into the second line.67 license identifier goes into the second line.
68
69 The license identifier line can then be followed by one or multiple
70 SPDX-FileCopyrightText lines if desired.
68 71
69|72|
70 73
scripts/checkpatch.pl+8−0
@@ -3856,6 +3856,14 @@ sub process { · 3855 unmodified lines
3856 "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr);3856 "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr);
3857 }3857 }
3858 3858
3859# check for disallowed SPDX file tags
3860 if ($rawline =~ /\bSPDX-.*:/ &&
3861 $rawline !~ /\bSPDX-License-Identifier:/ &&
3862 $rawline !~ /\bSPDX-FileCopyrightText:/) {
3863 WARN("SPDX_LICENSE_TAG",
3864 "Disallowed SPDX tag\n" . $herecurr);
3865 }
3866
3859# line length limit (with some exclusions)3867# line length limit (with some exclusions)
3860#3868#
3861# There are a few types of lines that may extend beyond $max_line_length:3869# There are a few types of lines that may extend beyond $max_line_length: