The patch titled Subject: checkpatch: validate SPDX license with spdxcheck.py has been added to the -mm tree. Its filename is checkpatch-validate-spdx-license-with-spdxcheckpy.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-validate-spdx-license-with-spdxcheckpy.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-validate-spdx-license-with-spdxcheckpy.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joe Perches <joe@xxxxxxxxxxx> Subject: checkpatch: validate SPDX license with spdxcheck.py Use the existing scripts/spdxcheck.py to validate any SPDX-License-Identifier found in line 1 or 2 of patches or files. Miscellanea: o Properly indent the existing SPDX-License-Identifier block. Link: http://lkml.kernel.org/r/05b832407b24e0a27e419906187cd863bc1617c7.camel@xxxxxxxxxxx Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Acked-by: Rob Herring <robh@xxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff -puN scripts/checkpatch.pl~checkpatch-validate-spdx-license-with-spdxcheckpy scripts/checkpatch.pl --- a/scripts/checkpatch.pl~checkpatch-validate-spdx-license-with-spdxcheckpy +++ a/scripts/checkpatch.pl @@ -849,6 +849,16 @@ sub is_maintained_obsolete { return $status =~ /obsolete/i; } +sub is_SPDX_License_valid { + my ($license) = @_; + + return 1 if (!$tree || which("python") eq "" || !(-e "$root/scripts/spdxcheck.py")); + + my $status = `echo "$license" | python $root/scripts/spdxcheck.py -`; + return 0 if ($status ne ""); + return 1; +} + my $camelcase_seeded = 0; sub seed_camelcase_includes { return if ($camelcase_seeded); @@ -2978,8 +2988,14 @@ sub process { if ($comment !~ /^$/ && $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { - WARN("SPDX_LICENSE_TAG", - "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); + WARN("SPDX_LICENSE_TAG", + "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); + } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { + my $spdx_license = $1; + if (!is_SPDX_License_valid($spdx_license)) { + WARN("SPDX_LICENSE_TAG", + "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); + } } } } _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are spdxcheck-work-with-current-head-licenses-directory.patch checkpatch-add-a-strict-test-for-structs-with-bool-member-definitions.patch checkpatch-add-fix-for-concatenated_string-and-string_fragments.patch checkpatch-improve-runtime-execution-speed-a-little.patch checkpatch-fix-macro-argument-reuse-test.patch checkpatch-validate-spdx-license-with-spdxcheckpy.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html