public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Rob Herring <robh@kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH] checkpatch.pl: Add SPDX license tag check for dts files and headers
Date: Thu, 23 Feb 2017 11:10:52 -0800	[thread overview]
Message-ID: <1487877052.14159.45.camel@perches.com> (raw)
In-Reply-To: <CAL_JsqL4ZztUvSevr4Co55n6w10TZaydGDyp4HJxHszFNvkVxw@mail.gmail.com>

On Thu, 2017-02-23 at 12:45 -0600, Rob Herring wrote:
> On Thu, Feb 23, 2017 at 11:51 AM, Joe Perches <joe@perches.com> wrote:
> > On Thu, 2017-02-23 at 09:56 -0600, Rob Herring wrote:
> > > Add a check for using SPDX-License-Identifier tags to define the license of
> > > .dts{i} and DT header files rather than using free form license text. This
> > > check looks for GPL, BSD, or X11(really incorrectly labeled MIT license)
> > > license text which are the commonly used DT licenses.
> > 
> > Hi Rob.
> > 
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > Cc: Andy Whitcroft <apw@canonical.com>
> > > Cc: Joe Perches <joe@perches.com>
> > > ---
> > >  scripts/checkpatch.pl | 13 +++++++++++++
> > >  1 file changed, 13 insertions(+)
> > > 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > index 982c52ca6473..ce802b3146e3 100755
> > > --- a/scripts/checkpatch.pl
> > > +++ b/scripts/checkpatch.pl
> > > @@ -2139,6 +2139,7 @@ sub process {
> > >       my $commit_log_has_diff = 0;
> > >       my $reported_maintainer_file = 0;
> > >       my $non_utf8_charset = 0;
> > > +     my $licensefile = '';
> > 
> > Maybe this should be $spdx_license_file
> > but what's the actual reason to check if
> > multiple license bits are in a single file?
> 
> Yes, just to get a single warning per file since the license matching
> can get multiple hits.
> 
> Really what I'd like to do is warn if an SPDX tag is not present in
> any added file. Having a check for something missing doesn't really
> work well with checkpatch at least in a scalable way that I saw.

That isn't really possible with checkpatch as
I'm sure you know that it looks at patch
contexts and it isn't really meant to scan
entire files.

You might be better off with a separate script
like the checkincludes.pl one.

You might possibly integrate that script into
checkpatch by looking at the "new file mode"
block, remember those and see if in the patch
each appropriate file has one of the spdx tags.

  reply	other threads:[~2017-02-23 19:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23 15:56 [PATCH] checkpatch.pl: Add SPDX license tag check for dts files and headers Rob Herring
2017-02-23 17:51 ` Joe Perches
2017-02-23 18:45   ` Rob Herring
2017-02-23 19:10     ` Joe Perches [this message]
2017-06-07  8:45 ` Masahiro Yamada
2017-06-09 13:56   ` Rob Herring

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=1487877052.14159.45.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=devicetree@vger.kernel.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