Skip to contentSkip to conversation

gpio: delete MODULE_ tags in non-modular drivers

PATCH In review Paul Gortmaker 3 participants 10 messages Aug 22, 2016 – Aug 23, 2016

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

cover gpio: delete MODULE_ tags in non-modular drivers

A nice simple series, with zero runtime changes. We delete tags like MODULE_LICENSE, MODULE_AUTHOR (while ensuring the documentation at the top of file reflects author and license) etc from bool drivers where the tags are no-ops.

Then we are free to delete the module.h include, which we now know adds about 750kB of output to an otherwise headerless empty file processed by cpp. In addition, it will be clear that the driver is non-modular now, when inspecting the source code.

---

Cc Alexandre Courbot <[email protected]>
Cc Daniel Mack <[email protected]>
Cc Juergen Beisert <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Mathias Nyman <[email protected]>
Cc Shiraz Hashim <[email protected]>
Cc Stefan Agner <[email protected]>

Paul Gortmaker (4):
gpio: msic: drop unused MODULE_ tags from non-modular code
gpio: mxc: drop unused MODULE_ tags from non-modular code
gpio: spear-spics: drop unused MODULE_ tags from non-modular code
gpio: vf610: drop unused MODULE_ tags from non-modular code

 drivers/gpio/gpio-msic.c        |  6 ------
 drivers/gpio/gpio-mxc.c         | 10 ++--------
 drivers/gpio/gpio-spear-spics.c |  7 +------
 drivers/gpio/gpio-vf610.c       |  7 +------
 4 files changed, 4 insertions(+), 26 deletions(-)
Signature · 1 line
2.8.4
#1 lore raw

PATCH 1/4 gpio: msic: drop unused MODULE_ tags from non-modular code

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_MSIC
drivers/gpio/Kconfig: bool "Intel MSIC mixed signal gpio support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

We don't replace module.h with init.h since the file already has that.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Mathias Nyman <[email protected]>
---
 drivers/gpio/gpio-msic.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpio/gpio-msic.c +0 -6
index d75649787e6c..1b7ce7f85886 100644
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -328,9 +327,4 @@ static int __init platform_msic_gpio_init(void)
 {
 	return platform_driver_register(&platform_msic_gpio_driver);
 }
-
 subsys_initcall(platform_msic_gpio_init);
-
-MODULE_AUTHOR("Mathias Nyman <[email protected]>");
-MODULE_DESCRIPTION("Intel Medfield MSIC GPIO driver");
-MODULE_LICENSE("GPL v2");
Signature · 1 line
2.8.4
#2 lore raw

Re: [PATCH 1/4] gpio: msic: drop unused MODULE_ tags from non-modular code

Quoted 13 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_MSIC
drivers/gpio/Kconfig: bool "Intel MSIC mixed signal gpio support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Quoted 7 lines

We don't replace module.h with init.h since the file already has that.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Mathias Nyman <[email protected]>

Patch applied.

Yours,
Linus Walleij

#3 lore raw

PATCH 2/4 gpio: mxc: drop unused MODULE_ tags from non-modular code

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_MXC
drivers/gpio/Kconfig: def_bool y

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Note the original e-mail had a missing/typo'd @ symbol anyway.

We don't replace module.h with init.h since the file already has that.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Daniel Mack <[email protected]>
Cc Juergen Beisert <[email protected]>
---
 drivers/gpio/gpio-mxc.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/gpio/gpio-mxc.c +2 -8
index 1b342a3842c8..e35af5249478 100644
@@ -2,7 +2,8 @@
  * MXC GPIO support. (c) 2008 Daniel Mack <[email protected]>
  * Copyright 2008 Juergen Beisert, [email protected]
  *
- * Based on code from Freescale,
+ * Based on code from Freescale Semiconductor,
+ * Authors: Daniel Mack, Juergen Beisert.
  * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or
@@ -33,7 +34,6 @@
 #include <linux/gpio.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
-#include <linux/module.h>
 #include <linux/bug.h>
 
 enum mxc_gpio_hwtype {
@@ -511,9 +511,3 @@ static int __init gpio_mxc_init(void)
 	return platform_driver_register(&mxc_gpio_driver);
 }
 postcore_initcall(gpio_mxc_init);
-
-MODULE_AUTHOR("Freescale Semiconductor, "
-	      "Daniel Mack <danielncaiaq.de>, "
-	      "Juergen Beisert <[email protected]>");
-MODULE_DESCRIPTION("Freescale MXC GPIO");
-MODULE_LICENSE("GPL");
Signature · 1 line
2.8.4
#4 lore raw

Re: [PATCH 2/4] gpio: mxc: drop unused MODULE_ tags from non-modular code

Quoted 14 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_MXC
drivers/gpio/Kconfig: def_bool y

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Note the original e-mail had a missing/typo'd @ symbol anyway.

Quoted 8 lines

We don't replace module.h with init.h since the file already has that.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Daniel Mack <[email protected]>
Cc Juergen Beisert <[email protected]>

Patch applied.

Yours,
Linus Walleij

#5 lore raw

PATCH 3/4 gpio: spear-spics: drop unused MODULE_ tags from non-modular code

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_SPEAR_SPICS
drivers/gpio/Kconfig: bool "ST SPEAr13xx SPI Chip Select as GPIO support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information is now contained at the top of the file in the comments.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Shiraz Hashim <[email protected]>
---
 drivers/gpio/gpio-spear-spics.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpio/gpio-spear-spics.c +1 -6
index 7ffd16495286..22267479ba68 100644
@@ -12,7 +12,7 @@
 #include <linux/err.h>
 #include <linux/gpio.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/types.h>
@@ -183,7 +183,6 @@ static const struct of_device_id spics_gpio_of_match[] = {
 	{ .compatible = "st,spear-spics-gpio" },
 	{}
 };
-MODULE_DEVICE_TABLE(of, spics_gpio_of_match);
 
 static struct platform_driver spics_gpio_driver = {
 	.probe = spics_gpio_probe,
@@ -198,7 +197,3 @@ static int __init spics_gpio_init(void)
 	return platform_driver_register(&spics_gpio_driver);
 }
 subsys_initcall(spics_gpio_init);
-
-MODULE_AUTHOR("Shiraz Hashim <[email protected]>");
-MODULE_DESCRIPTION("STMicroelectronics SPEAr SPI Chip Select Abstraction");
-MODULE_LICENSE("GPL");
Signature · 1 line
2.8.4
#6 lore raw

Re: [PATCH 3/4] gpio: spear-spics: drop unused MODULE_ tags from non-modular code

Quoted 13 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_SPEAR_SPICS
drivers/gpio/Kconfig: bool "ST SPEAr13xx SPI Chip Select as GPIO support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information is now contained at the top of the file in the comments.

Quoted 7 lines

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Shiraz Hashim <[email protected]>

Patch applied.

Yours,
Linus Walleij

#7 lore raw

Re: [PATCH 3/4] gpio: spear-spics: drop unused MODULE_ tags from non-modular code

In reply to Paul Gortmaker

2016-08-23 1:48 GMT+09:00 Paul Gortmaker <[email protected]>:

Quoted 29 lines

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_SPEAR_SPICS
drivers/gpio/Kconfig: bool "ST SPEAr13xx SPI Chip Select as GPIO support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information is now contained at the top of the file in the comments.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Shiraz Hashim <[email protected]>
---
 drivers/gpio/gpio-spear-spics.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpio/gpio-spear-spics.c +0 -0
index 7ffd16495286..22267479ba68 100644

drivers/gpio/gpio-spear-spics.c line 18

Quoted 8 lines
drivers/gpio/gpio-spear-spics.c +1 -1
@@ -12,7 +12,7 @@
 #include <linux/err.h>
 #include <linux/gpio.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/types.h>

Please keep the includes sorted alphabetically,
i.e. <linux/init.h> above <linux/io.h>.

I was a little late, though.

Signature · 2 lines
Best Regards
Masahiro Yamada
#8 lore raw

PATCH 4/4 gpio: vf610: drop unused MODULE_ tags from non-modular code

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_VF610
drivers/gpio/Kconfig: def_bool y

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information is now contained at the top of the file in the comments.

We don't replace module.h with init.h since the file already has that.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Stefan Agner <[email protected]>
---
 drivers/gpio/gpio-vf610.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpio/gpio-vf610.c +1 -6
index 6284bdbe1e0c..3edb09cb9ee0 100644
@@ -1,5 +1,5 @@
 /*
- * vf610 GPIO support through PORT and GPIO module
+ * Freescale vf610 GPIO support through PORT and GPIO
  *
  * Copyright (c) 2014 Toradex AG.
  *
@@ -23,7 +23,6 @@
 #include <linux/io.h>
 #include <linux/ioport.h>
 #include <linux/irq.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -289,7 +288,3 @@ static int __init gpio_vf610_init(void)
 	return platform_driver_register(&vf610_gpio_driver);
 }
 device_initcall(gpio_vf610_init);
-
-MODULE_AUTHOR("Stefan Agner <[email protected]>");
-MODULE_DESCRIPTION("Freescale VF610 GPIO");
-MODULE_LICENSE("GPL v2");
Signature · 1 line
2.8.4
#9 lore raw

Re: [PATCH 4/4] gpio: vf610: drop unused MODULE_ tags from non-modular code

Quoted 13 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_VF610
drivers/gpio/Kconfig: def_bool y

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information is now contained at the top of the file in the comments.

Quoted 7 lines

We don't replace module.h with init.h since the file already has that.

Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Stefan Agner <[email protected]>

Patch applied.

Yours,
Linus Walleij