From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Whitcroft <apw@canonical.com>, Rob Herring <robh@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Dan Williams <dan.j.williams@intel.org>
Subject: Re: [PATCH] checkpatch: Verify SPDX comment style
Date: Tue, 05 Feb 2019 18:21:39 -0800 [thread overview]
Message-ID: <5e4a8fa7901148fbcd77ab391e6dd0e6bf95777f.camel@perches.com> (raw)
In-Reply-To: <20190205142136.9e7105239919596d0b2b6548@linux-foundation.org>
On Tue, 2019-02-05 at 14:21 -0800, Andrew Morton wrote:
> On Thu, 10 Jan 2019 16:05:11 -0800 Joe Perches <joe@perches.com> wrote:
>
> > Using SPDX commenting style // or /* is specified for
> > various file types in Documentation/process/license-rules.rst
> > so add an appropriate test for .[chsS] files because many
> > proposed file additions and patches do not use the correct style.
>
> Dan's
> http://lkml.kernel.org/r/154899811738.3165233.12325692939590944259.stgit@dwillia2-desk3.amr.corp.intel.com
> is giving me
>
> WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
> #500: FILE: mm/shuffle.h:1:
> +// SPDX-License-Identifier: GPL-2.0
>
> and switching it to /* */ doesn't fix. This happens with or without
> this patch applied. What to do?
Umm, fix checkpatch?
---
scripts/checkpatch.pl | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 37f81fe93c01..216480ae29d1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3053,21 +3053,21 @@ sub process {
# check SPDX comment style for .[chsS] files
if ($realfile =~ /\.[chsS]$/ &&
$rawline =~ /SPDX-License-Identifier:/ &&
- $rawline !~ /^\+\s*\Q$comment\E\s*/) {
+ $rawline !~ m@^\+\s*\Q$comment\E\s*@) {
WARN("SPDX_LICENSE_TAG",
"Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr);
}
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);
+ $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) {
+ 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);
- }
+ my $spdx_license = $1;
+ if (!is_SPDX_License_valid($spdx_license)) {
+ WARN("SPDX_LICENSE_TAG",
+ "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
+ }
}
}
}
prev parent reply other threads:[~2019-02-06 2:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 0:05 Joe Perches
2019-01-23 11:04 ` Joe Perches
2019-02-05 22:21 ` Andrew Morton
2019-02-06 2:21 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e4a8fa7901148fbcd77ab391e6dd0e6bf95777f.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=dan.j.williams@intel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®