[PATCH] usb: raw-gadget: upgrade license identifier

andrey.konovalov@linux.dev posted 1 patch 4 years, 6 months ago
drivers/usb/gadget/legacy/raw_gadget.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] usb: raw-gadget: upgrade license identifier
Posted by andrey.konovalov@linux.dev 4 years, 6 months ago
From: Andrey Konovalov <andreyknvl@gmail.com>

Most of the USB gadget modules are licensed as GPL-2.0+. There is no
reason not to allow using Raw Gadget code under a newer GPL version.

Change SPDX identifier from GPL-2.0 to GPL-2.0+.

Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>

---

I don't know whether such license change is possible and what it
requires.

Initially, when creating raw_gadget.c, I just copied GPL-2.0 from
somewhere as it didn't seem to matter. Recently, I was looking into
adding a license to a project that reuses both dummy_hcd.c and
raw_gadget.c, and I noticed the difference in licensing rules.

Hence this patch.
---
 drivers/usb/gadget/legacy/raw_gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/legacy/raw_gadget.c b/drivers/usb/gadget/legacy/raw_gadget.c
index c5a2c734234a..79d2363cb2b4 100644
--- a/drivers/usb/gadget/legacy/raw_gadget.c
+++ b/drivers/usb/gadget/legacy/raw_gadget.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * USB Raw Gadget driver.
  * See Documentation/usb/raw-gadget.rst for more details.
-- 
2.25.1

Re: [PATCH] usb: raw-gadget: upgrade license identifier
Posted by Greg Kroah-Hartman 4 years, 6 months ago
On Sat, Dec 25, 2021 at 11:32:36PM +0100, andrey.konovalov@linux.dev wrote:
> From: Andrey Konovalov <andreyknvl@gmail.com>
> 
> Most of the USB gadget modules are licensed as GPL-2.0+. There is no
> reason not to allow using Raw Gadget code under a newer GPL version.
> 
> Change SPDX identifier from GPL-2.0 to GPL-2.0+.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
> 
> ---
> 
> I don't know whether such license change is possible and what it
> requires.

It requires the copyright holder to agree to change the license, as well
as anyone who as contributed to it.  If you so desire to do this, please
work with them and get the lawyers for those entities to sign off on the
patch and I will be glad to take it.

thanks,

greg k-h
Re: [PATCH] usb: raw-gadget: upgrade license identifier
Posted by Andrey Konovalov 4 years, 6 months ago
On Sun, Dec 26, 2021 at 9:08 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Sat, Dec 25, 2021 at 11:32:36PM +0100, andrey.konovalov@linux.dev wrote:
> > From: Andrey Konovalov <andreyknvl@gmail.com>
> >
> > Most of the USB gadget modules are licensed as GPL-2.0+. There is no
> > reason not to allow using Raw Gadget code under a newer GPL version.
> >
> > Change SPDX identifier from GPL-2.0 to GPL-2.0+.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
> >
> > ---
> >
> > I don't know whether such license change is possible and what it
> > requires.
>
> It requires the copyright holder to agree to change the license, as well
> as anyone who as contributed to it.  If you so desire to do this, please
> work with them and get the lawyers for those entities to sign off on the
> patch and I will be glad to take it.

Ah, never mind this patch then. I don't care enough to bother with
this. I'm not even sure what the difference is, but having less
restrictions seems better.

I wonder if checkpatch could alert about considering GPL-2.0+ when
adding new files.

Thanks!
Re: [PATCH] usb: raw-gadget: upgrade license identifier
Posted by Joe Perches 4 years, 6 months ago
On Sun, 2021-12-26 at 14:19 +0100, Andrey Konovalov wrote:
> I wonder if checkpatch could alert about considering GPL-2.0+ when
> adding new files.

No. Licensing is up to the author/submitter.

One nit checkpatch could warn about is the use of MODULE_LICENSE("GPL v2")
rather than MODULE_LICENSE("GPL") as that's an unnecessary distinction.

See: https://lore.kernel.org/all/alpine.DEB.2.21.1901282105450.1669@nanos.tec.linutronix.de/

Given there are a several thousand existing uses of "GPL v2" in the
kernel, do this check only for new patches and not existing files.
---
 scripts/checkpatch.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b01c36a15d9dd..5b00f1f491aff 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -7418,6 +7418,10 @@ sub process {
 				WARN("MODULE_LICENSE",
 				     "unknown module license " . $extracted_string . "\n" . $herecurr);
 			}
+			if (!$file && $extracted_string eq '"GPL v2"') {
+				WARN("MODULE_LICENSE",
+				     "Prefer \"GPL\" over \"GPL v2\" - see: https://lore.kernel.org/all/alpine.DEB.2.21.1901282105450.1669\@nanos.tec.linutronix.de/\n" . $herecurr);
+			}
 		}
 
 # check for sysctl duplicate constants


Re: [PATCH] usb: raw-gadget: upgrade license identifier
Posted by Andrey Konovalov 4 years, 6 months ago
On Sun, Dec 26, 2021 at 3:02 PM Joe Perches <joe@perches.com> wrote:
>
> On Sun, 2021-12-26 at 14:19 +0100, Andrey Konovalov wrote:
> > I wonder if checkpatch could alert about considering GPL-2.0+ when
> > adding new files.
>
> No. Licensing is up to the author/submitter.

You're right. However, knowingly choosing a license requires that the
author doesn't forget to look into the difference and understand it.

When I contributed this code, I didn't realize that GPL-2.0 and
GPL-2.0+ are different things. I was focused on the excitement of
contributing a new USB gadget driver.

What would have allowed my to not overlook this, is that if throughout
the _process_ of contributing a new module, something would _ask_ me:
"Is this really the license you want to use?".

Within my process of submitting kernel patches, that could have been
either checkpatch or an email bot.

I don't insist that this must be done by checkpatch; this could be
done by another entity. However, it would be nice to see this as an
explicit step of a standardized contribution process.

Thanks!