Skip to contentSkip to conversation

input: remove unneeded DRIVER_LICENSE #defines

PATCH Applied Greg Kroah-Hartman 3 participants 9 messages Nov 17, 2017 – Jan 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: remove unneeded DRIVER_LICENSE #defines

There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string.

This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference. For some of these drivers, the #define is just a few lines above the MODULE_LICENSE() line, which is extra pointless.

---
 drivers/input/misc/keyspan_remote.c | 3 +--
 drivers/input/tablet/acecad.c       | 3 +--
 drivers/input/tablet/hanwang.c      | 3 +--
 drivers/input/tablet/kbtab.c        | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)
drivers/input/misc/keyspan_remote.c +1 -2
index 77c47d6325fe..4f13b2f7bf4f 100644
@@ -20,7 +20,6 @@
 #define DRIVER_VERSION	"v0.1"
 #define DRIVER_AUTHOR	"Michael Downey <[email protected]>"
 #define DRIVER_DESC	"Driver for the USB Keyspan remote control."
-#define DRIVER_LICENSE	"GPL"
 
 /* Parameters that can be passed to the driver. */
 static int debug;
@@ -592,4 +591,4 @@ module_usb_driver(keyspan_driver);
 MODULE_DEVICE_TABLE(usb, keyspan_table);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
drivers/input/tablet/acecad.c +1 -2
index aebb3f9090cd..fcb67c7cd86b 100644
@@ -35,12 +35,11 @@
  */
 #define DRIVER_VERSION "v3.2"
 #define DRIVER_DESC    "USB Acecad Flair tablet driver"
-#define DRIVER_LICENSE "GPL"
 #define DRIVER_AUTHOR  "Edouard TISSERANT <[email protected]>"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
 
 #define USB_VENDOR_ID_ACECAD	0x0460
 #define USB_DEVICE_ID_FLAIR	0x0004
drivers/input/tablet/hanwang.c +1 -2
index df4bea96d7ed..70cb26bbfe1d 100644
@@ -30,11 +30,10 @@
 
 #define DRIVER_AUTHOR   "Xing Wei <[email protected]>"
 #define DRIVER_DESC     "USB Hanwang tablet driver"
-#define DRIVER_LICENSE  "GPL"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
 
 #define USB_VENDOR_ID_HANWANG		0x0b57
 #define HANWANG_TABLET_INT_CLASS	0x0003
drivers/input/tablet/kbtab.c +1 -2
index a41c3ff7c9af..bee18e33e261 100644
@@ -15,11 +15,10 @@
 #define DRIVER_VERSION "v0.0.2"
 #define DRIVER_AUTHOR "Josh Myer <[email protected]>"
 #define DRIVER_DESC "USB KB Gear JamStudio Tablet driver"
-#define DRIVER_LICENSE "GPL"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
 
 #define USB_VENDOR_ID_KBGEAR	0x084e
 
Signature · 1 line
2.15.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Greg Kroah-Hartman

There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string.

This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference. For some of these drivers, the #define is just a few lines above the MODULE_LICENSE() line, which is extra pointless.

Quoted 4 lines
Signature · 2 lines
Cordially
Philippe Ombredanne
maintainer Applied
#2 lore raw
Quoted 10 lines · Philippe Ombredanne
Quoted 8 lines · Greg Kroah-Hartman

There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string.

This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference. For some of these drivers, the #define is just a few lines above the MODULE_LICENSE() line, which is extra pointless.

Quoted 7 lines
Quoted 4 lines

Applied, thank you.

Signature · 1 line
Dmitry
maintainer
#3 lore raw
In reply to Greg Kroah-Hartman
Quoted 24 lines · Greg Kroah-Hartman

There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string.

This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference. For some of these drivers, the #define is just a few lines above the MODULE_LICENSE() line, which is extra pointless.

---
 drivers/input/misc/keyspan_remote.c | 3 +--
 drivers/input/tablet/acecad.c       | 3 +--
 drivers/input/tablet/hanwang.c      | 3 +--
 drivers/input/tablet/kbtab.c        | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)
drivers/input/misc/keyspan_remote.c +0 -0
index 77c47d6325fe..4f13b2f7bf4f 100644

drivers/input/misc/keyspan_remote.c line 23

Quoted 4 lines
drivers/input/misc/keyspan_remote.c +0 -1
@@ -20,7 +20,6 @@
 #define DRIVER_VERSION	"v0.1"
 #define DRIVER_AUTHOR	"Michael Downey <[email protected]>"
 #define DRIVER_DESC	"Driver for the USB Keyspan remote control."
-#define DRIVER_LICENSE	"GPL"

If we do this, can we also get rid of other DIRVER_* macros that are not useful?

Quoted 64 lines
drivers/input/misc/keyspan_remote.c +1 -1
 /* Parameters that can be passed to the driver. */
 static int debug;
@@ -592,4 +591,4 @@ module_usb_driver(keyspan_driver);
 MODULE_DEVICE_TABLE(usb, keyspan_table);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
drivers/input/tablet/acecad.c +1 -2
index aebb3f9090cd..fcb67c7cd86b 100644
@@ -35,12 +35,11 @@
  */
 #define DRIVER_VERSION "v3.2"
 #define DRIVER_DESC    "USB Acecad Flair tablet driver"
-#define DRIVER_LICENSE "GPL"
 #define DRIVER_AUTHOR  "Edouard TISSERANT <[email protected]>"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
 
 #define USB_VENDOR_ID_ACECAD	0x0460
 #define USB_DEVICE_ID_FLAIR	0x0004
drivers/input/tablet/hanwang.c +1 -2
index df4bea96d7ed..70cb26bbfe1d 100644
@@ -30,11 +30,10 @@
 
 #define DRIVER_AUTHOR   "Xing Wei <[email protected]>"
 #define DRIVER_DESC     "USB Hanwang tablet driver"
-#define DRIVER_LICENSE  "GPL"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
 
 #define USB_VENDOR_ID_HANWANG		0x0b57
 #define HANWANG_TABLET_INT_CLASS	0x0003
drivers/input/tablet/kbtab.c +1 -2
index a41c3ff7c9af..bee18e33e261 100644
@@ -15,11 +15,10 @@
 #define DRIVER_VERSION "v0.0.2"
 #define DRIVER_AUTHOR "Josh Myer <[email protected]>"
 #define DRIVER_DESC "USB KB Gear JamStudio Tablet driver"
-#define DRIVER_LICENSE "GPL"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_LICENSE("GPL");
 
 #define USB_VENDOR_ID_KBGEAR	0x084e
 
Signature · 1 line
2.15.0
Signature · 1 line
Dmitry
#4 lore raw
Quoted 20 lines · Dmitry Torokhov
Quoted 19 lines · Greg Kroah-Hartman

There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string.

This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference. For some of these drivers, the #define is just a few lines above the MODULE_LICENSE() line, which is extra pointless.

---
 drivers/input/misc/keyspan_remote.c | 3 +--
 drivers/input/tablet/acecad.c       | 3 +--
 drivers/input/tablet/hanwang.c      | 3 +--
 drivers/input/tablet/kbtab.c        | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)
Quoted 12 lines

drivers/input/misc/keyspan_remote.c line 23

Quoted 9 lines
drivers/input/misc/keyspan_remote.c +0 -1
index 77c47d6325fe..4f13b2f7bf4f 100644
@@ -20,7 +20,6 @@
 #define DRIVER_VERSION	"v0.1"
 #define DRIVER_AUTHOR	"Michael Downey <[email protected]>"
 #define DRIVER_DESC	"Driver for the USB Keyspan remote control."
-#define DRIVER_LICENSE	"GPL"

If we do this, can we also get rid of other DIRVER_* macros that are not useful?

Please do, I got rid of all of the DRIVER_VERSION crap in the drivers/usb/ tree a release or so ago, as they make no sense at all. The other defines are also really silly and can be cleaned up too.

Want me to do that for drivers/input/ for you?

thanks,

greg "I'm a janitor now" k-h

#5 lore raw
Quoted 10 lines · Greg Kroah-Hartman

Please do, I got rid of all of the DRIVER_VERSION crap in the drivers/usb/ tree a release or so ago, as they make no sense at all. The other defines are also really silly and can be cleaned up too.

Want me to do that for drivers/input/ for you?

thanks,

greg "I'm a janitor now" k-h

Thing could get worse: you could become a documentalist like tglx turned into.

For the fun, another weird thingie that I once stumbled upon in an out-of-tree third-party module:

MODULE_LICENSE("\x47\x50\x4c\x20\x76\x32");

... which was most likely from a GPL-shy closet Free software
advocate: this is "GPL v2" in ASCII.

Signature · 2 lines
Cordially
Philippe Ombredanne
#6 lore raw
Quoted 16 lines · Philippe Ombredanne
Quoted 10 lines · Greg Kroah-Hartman

Please do, I got rid of all of the DRIVER_VERSION crap in the drivers/usb/ tree a release or so ago, as they make no sense at all. The other defines are also really silly and can be cleaned up too.

Want me to do that for drivers/input/ for you?

thanks,

greg "I'm a janitor now" k-h

Thing could get worse: you could become a documentalist like tglx turned into.

Quoted 7 lines

For the fun, another weird thingie that I once stumbled upon in an out-of-tree third-party module:

MODULE_LICENSE("\x47\x50\x4c\x20\x76\x32");

... which was most likely from a GPL-shy closet Free software
advocate: this is "GPL v2" in ASCII.

Hah, we've seen worse with people trying to put '0x00' in the middle of the string to fake out the string checking logic. Whenever stuff like that gets pointed out to the legal department of the company involved, stuff gets fixed fast, trying to 'circumvent' a license check is really frowned apon by almost all legal juristictions :)

So, if you want to point that code out to me offline, I'm sure I could have some fun...

thanks,

greg k-h

#7 lore raw
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Philippe Ombredanne
Quoted 10 lines · Greg Kroah-Hartman

Please do, I got rid of all of the DRIVER_VERSION crap in the drivers/usb/ tree a release or so ago, as they make no sense at all. The other defines are also really silly and can be cleaned up too.

Want me to do that for drivers/input/ for you?

thanks,

greg "I'm a janitor now" k-h

Thing could get worse: you could become a documentalist like tglx turned into.

For the fun, another weird thingie that I once stumbled upon in an out-of-tree third-party module:

MODULE_LICENSE("\x47\x50\x4c\x20\x76\x32");

Quoted 7 lines
Quoted 2 lines

... which was most likely from a GPL-shy closet Free software
advocate: this is "GPL v2" in ASCII.

Hah, we've seen worse with people trying to put '0x00' in the middle of the string to fake out the string checking logic. Whenever stuff like that gets pointed out to the legal department of the company involved, stuff gets fixed fast,

Thanks!
FWIW, this was fixed fast alright when I pointed it to the software team that had farted this.
This happened a couple years ago.

I have seen worse than using '0x00' once: a combo of a patched insmod to remove all the MODULE_LICENSE checks especially on "Proprietary" AND a patched kernel adding a hook in module.[c,h] and some core net patched code to make userspace, "look-ma-kernelspace-gpl-will-not-apply-here" modules possible to do network packet filtering in userspace. Which was also a nice try but another baseless fart, beside being also terrible from a perf and reliabiility point of view.

The squirrelly thing was that only a handful of line of code were
modified: a few needles hidden in a giant haystack.
If there were an award for "Sneakiest f*ck-the-gpl attempt", these folks would have been winning the trophy hands down with special jury congratulations.

Quoted 2 lines

trying to 'circumvent' a license check is really
frowned apon by almost all legal juristictions :)

In the US, in a weird twist of unintended consequences, this might be likely a violation of the infamous DMCA.

Signature · 2 lines
Cordially
Philippe Ombredanne
maintainer
#8 lore raw
In reply to Greg Kroah-Hartman
Quoted 34 lines · Greg Kroah-Hartman
Quoted 20 lines · Dmitry Torokhov
Quoted 19 lines · Greg Kroah-Hartman

There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string.

This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference. For some of these drivers, the #define is just a few lines above the MODULE_LICENSE() line, which is extra pointless.

---
 drivers/input/misc/keyspan_remote.c | 3 +--
 drivers/input/tablet/acecad.c       | 3 +--
 drivers/input/tablet/hanwang.c      | 3 +--
 drivers/input/tablet/kbtab.c        | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)
Quoted 12 lines

drivers/input/misc/keyspan_remote.c line 23

Quoted 9 lines
drivers/input/misc/keyspan_remote.c +0 -1
index 77c47d6325fe..4f13b2f7bf4f 100644
@@ -20,7 +20,6 @@
 #define DRIVER_VERSION	"v0.1"
 #define DRIVER_AUTHOR	"Michael Downey <[email protected]>"
 #define DRIVER_DESC	"Driver for the USB Keyspan remote control."
-#define DRIVER_LICENSE	"GPL"

If we do this, can we also get rid of other DIRVER_* macros that are not useful?

Quoted 6 lines

Please do, I got rid of all of the DRIVER_VERSION crap in the drivers/usb/ tree a release or so ago, as they make no sense at all. The other defines are also really silly and can be cleaned up too.

Want me to do that for drivers/input/ for you?

That would be great, yes.

Thanks.

Signature · 1 line
Dmitry