The patch titled Subject: checkpatch: add test for SPDX-License-Identifier on wrong line # has been added to the -mm tree. Its filename is checkpatch-add-test-for-spdx-license-identifier-on-wrong-line.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-add-test-for-spdx-license-identifier-on-wrong-line.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-add-test-for-spdx-license-identifier-on-wrong-line.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: add test for SPDX-License-Identifier on wrong line # Warn when any SPDX-License-Identifier: tag is not created on the proper line number. Link: http://lkml.kernel.org/r/9b74ee87f8c1b8fd310e213fcb4994d58610fcb6.camel@xxxxxxxxxxx Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx> Cc: "Enrico Weigelt, metux IT consult" <lkml@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/scripts/checkpatch.pl~checkpatch-add-test-for-spdx-license-identifier-on-wrong-line +++ a/scripts/checkpatch.pl @@ -3075,6 +3075,14 @@ sub process { # check we are in a valid source file if not then ignore this hunk next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); +# check for using SPDX-License-Identifier on the wrong line number + if ($realline != $checklicenseline && + $rawline =~ /\bSPDX-License-Identifier:/ && + substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) { + WARN("SPDX_LICENSE_TAG", + "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr); + } + # line length limit (with some exclusions) # # There are a few types of lines that may extend beyond $max_line_length: _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are checkpatch-dont-interpret-stack-dumps-as-commit-ids.patch checkpatch-verify-spdx-comment-style.patch checkpatch-add-some-new-alloc-functions-to-various-tests.patch checkpatch-add-test-for-spdx-license-identifier-on-wrong-line.patch checkpatch-fix-something.patch