From a45b2bf4a455187456b00f1c43b40f667823fef4 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 10 Feb 2023 10:47:36 +0100 Subject: [PATCH] tools: allow // SPDX... in checkpatch.pl Using // style comments for the SPDX license identifier was kind of an intentional choice to make it stand out as "directive-like" comment (and also to constrain it to the one line.) Signed-off-by: David Lamparter --- tools/checkpatch.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index 69eb0ef954..b5892e8da5 100755 --- a/tools/checkpatch.pl +++ b/tools/checkpatch.pl @@ -3627,7 +3627,9 @@ sub process { # no C99 // comments if ($line =~ m{//}) { - if (!$allow_c99_comments) { + if ($rawlines[$linenr - 1] =~ /SPDX-License-Identifier:/) { + # ignore + } elsif (!$allow_c99_comments) { if(ERROR("C99_COMMENTS", "do not use C99 // comments\n" . $herecurr) && $fix) { -- 2.39.5