public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andy Whitcroft <apw@canonical.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] checkpatch: validate MODULE_LICENSE content
Date: Tue, 7 Apr 2015 12:55:49 -0700	[thread overview]
Message-ID: <20150407195548.GA19186@sonymobile.com> (raw)
In-Reply-To: <1428436083.8406.28.camel@perches.com>

On Tue 07 Apr 12:48 PDT 2015, Joe Perches wrote:

> On Tue, 2015-04-07 at 12:37 -0700, Bjorn Andersson wrote:
> > There is a well defined list of expected values for MODULE_LICENSE so
> > warn the user upon usage of unknown values.
> > 
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> > ---
> > 
> > Thanks for the review Joe!
> 
> No charge.
> 
> > "Proprietary" is in the list because this is the full list of "valid" values
> > mentioned in include/linux/module.h. So it's the list of licenses valid for
> > submission, but rather the list of valid values.
> 
> So the "Proprietary" entry is only for non kernel-tree uses.
> I wonder if the kernel checkpatch script should account for that.
> 

The way I read the comment in module.h is that if you're writing a
non-free kernel module then you should mark it with "Proprietary".

If people doing so are using checkpatch that's great, but it's just
included for completeness, not to argue about the concept of proprietary
kernel modules.

> I've no strong opinion though if Andrew wants to accept this as-is.
> 

Let me know and I'll drop it from the patch.

> cheers, Joe
> 

Thanks,
Bjorn

> > Changes since v1:
> > - Fixed nits pointed out by Joe
> > - Added comment to clarify the purpose, as well as origin of the values
> > 
> >  scripts/checkpatch.pl | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 9a8b2bd..ca10d79 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -5431,6 +5431,24 @@ sub process {
> >  				}
> >  			}
> >  		}
> > +
> > +# validate content of MODULE_LICENSE against list from include/linux/module.h
> > +		if ($line =~ /\bMODULE_LICENSE\s*\(\s*($String)\s*\)/) {
> > +			my $extracted_string = get_quoted_string($line, $rawline);
> > +			my $valid_licenses = qr{
> > +						GPL|
> > +						GPL\ v2|
> > +						GPL\ and\ additional\ rights|
> > +						Dual\ BSD/GPL|
> > +						Dual\ MIT/GPL|
> > +						Dual\ MPL/GPL|
> > +						Proprietary
> > +					}x;
> > +			if ($extracted_string !~ /^"(?:$valid_licenses)"$/x) {
> > +				WARN("MODULE_LICENSE",
> > +				     "unknown module license " . $extracted_string . "\n" . $herecurr);
> > +			}
> > +		}
> >  	}
> >  
> >  	# If we have no input at all, then there is nothing to report on
> 
> 
> 

  reply	other threads:[~2015-04-07 19:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 18:43 [PATCH] checkpatch: validate MODULE_LICENSE content Bjorn Andersson
2015-04-07  0:17 ` Joe Perches
2015-04-07 19:37   ` [PATCH v2] " Bjorn Andersson
2015-04-07 19:48     ` Joe Perches
2015-04-07 19:55       ` Bjorn Andersson [this message]
2015-04-07 20:16         ` Andrew Morton
2015-06-09 12:11           ` Michal Simek
2015-06-09 14:57             ` Joe Perches

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=20150407195548.GA19186@sonymobile.com \
    --to=bjorn.andersson@sonymobile.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.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