Skip to content

Commit ebf1baf

Browse files
krzkgregkh
authored andcommitted
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. 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>
1 parent f338e77 commit ebf1baf

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Documentation/process/license-rules.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ License identifier syntax
6363
The SPDX license identifier in kernel files shall be added at the first
6464
possible line in a file which can contain a comment. For the majority
6565
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 SPDX
67-
identifier goes into the second line.
66+
'#!PATH_TO_INTERPRETER' in the first line. For those scripts, the SPDX
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.
6871

6972
|
7073

scripts/checkpatch.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3856,6 +3856,14 @@ sub process {
38563856
"Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr);
38573857
}
38583858

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+
38593867
# line length limit (with some exclusions)
38603868
#
38613869
# There are a few types of lines that may extend beyond $max_line_length:

0 commit comments

Comments
 (0)