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 <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2023-02-10 10:47:36 +01:00
parent 0d60d63f94
commit a45b2bf4a4
1 changed files with 3 additions and 1 deletions

View File

@ -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) {