All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] PCI: more trivial demodularization of builtin code
@ 2016-08-22 21:59 ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Bjorn Helgaas, Jingoo Han, Krzysztof Kozlowski,
	Kukjin Kim, Ley Foon Tan, Lucas Stach, Pratyush Anand,
	Richard Zhu, Tom Long Nguyen, Will Deacon, rfi, linux-pci,
	linux-samsung-soc

This is another group of commits that was chosen since they really don't
change anything even at a binary object file level ; they just replace
module_init with device_initcall (which are identical), and remove some
MODULE_<blah> tags that are no-ops in code.  So the run time regression
risk is zero here.

More specifically, we are doing the following to these PCI files that
currently can only be built-in:

 -- remove the include of module.h ; replace it with init.h as req'd

 -- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in.

 -- replace module_init (if present) with device_initcall, which is
    functionally identical once CPP has processed the source.

 -- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION
    while ensuring the contained info is present in the file comments.

Build tested for allmodconfig on several arch, including ARM and ARM-64
on a recent linux-next baseline.

Some non-modular PCI files still remain with unused __exit and/or .remove
functions.  Those will be dealt with in a separate series after this.

Also note that we looked into modularizing some of the PCI_DW stuff at
an earlier time[1] but that ran into problems such as trying to create
unwind for hook_fault_code etc. that wasn't easily solved.  So we just
go with keeping the code runtime functionally equivalent to what it was.

Paul.

[1] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortmaker@windriver.com

---

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Tom Long Nguyen <tom.l.nguyen@intel.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: rfi@lists.rocketboards.org
Cc: linux-pci@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org

Paul Gortmaker (8):
  PCI: altera: make msi explicitly non-modular
  PCI: altera: make it explicitly non-modular
  PCI: imx6: make it explicitly non-modular
  PCI: portdrv: make it explicitly non-modular
  PCI: spear13xx: make it explicitly non-modular
  PCI: designware: make host support explicitly non-modular
  PCI: exynos: make host support explicitly non-modular
  PCI: generic: make host-common explicitly non-modular

 drivers/pci/host/pci-exynos.c      |  7 +------
 drivers/pci/host/pci-host-common.c |  7 ++-----
 drivers/pci/host/pci-imx6.c        |  9 +--------
 drivers/pci/host/pcie-altera-msi.c | 10 +++++-----
 drivers/pci/host/pcie-altera.c     | 12 +++++-------
 drivers/pci/host/pcie-designware.c |  5 -----
 drivers/pci/host/pcie-spear13xx.c  | 11 ++---------
 drivers/pci/pcie/portdrv_pci.c     |  8 +-------
 8 files changed, 17 insertions(+), 52 deletions(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/8] PCI: more trivial demodularization of builtin code
@ 2016-08-22 21:59 ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Bjorn Helgaas, Jingoo Han, Krzysztof Kozlowski,
	Kukjin Kim, Ley Foon Tan, Lucas Stach, Pratyush Anand,
	Richard Zhu, Tom Long Nguyen, Will Deacon, rfi, linux-pci,
	linux-samsung-soc

This is another group of commits that was chosen since they really don't
change anything even at a binary object file level ; they just replace
module_init with device_initcall (which are identical), and remove some
MODULE_<blah> tags that are no-ops in code.  So the run time regression
risk is zero here.

More specifically, we are doing the following to these PCI files that
currently can only be built-in:

 -- remove the include of module.h ; replace it with init.h as req'd

 -- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in.

 -- replace module_init (if present) with device_initcall, which is
    functionally identical once CPP has processed the source.

 -- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION
    while ensuring the contained info is present in the file comments.

Build tested for allmodconfig on several arch, including ARM and ARM-64
on a recent linux-next baseline.

Some non-modular PCI files still remain with unused __exit and/or .remove
functions.  Those will be dealt with in a separate series after this.

Also note that we looked into modularizing some of the PCI_DW stuff at
an earlier time[1] but that ran into problems such as trying to create
unwind for hook_fault_code etc. that wasn't easily solved.  So we just
go with keeping the code runtime functionally equivalent to what it was.

Paul.

[1] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortmaker@windriver.com

---

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Tom Long Nguyen <tom.l.nguyen@intel.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: rfi@lists.rocketboards.org
Cc: linux-pci@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org

Paul Gortmaker (8):
  PCI: altera: make msi explicitly non-modular
  PCI: altera: make it explicitly non-modular
  PCI: imx6: make it explicitly non-modular
  PCI: portdrv: make it explicitly non-modular
  PCI: spear13xx: make it explicitly non-modular
  PCI: designware: make host support explicitly non-modular
  PCI: exynos: make host support explicitly non-modular
  PCI: generic: make host-common explicitly non-modular

 drivers/pci/host/pci-exynos.c      |  7 +------
 drivers/pci/host/pci-host-common.c |  7 ++-----
 drivers/pci/host/pci-imx6.c        |  9 +--------
 drivers/pci/host/pcie-altera-msi.c | 10 +++++-----
 drivers/pci/host/pcie-altera.c     | 12 +++++-------
 drivers/pci/host/pcie-designware.c |  5 -----
 drivers/pci/host/pcie-spear13xx.c  | 11 ++---------
 drivers/pci/pcie/portdrv_pci.c     |  8 +-------
 8 files changed, 17 insertions(+), 52 deletions(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/8] PCI: altera: make msi explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
  (?)
@ 2016-08-22 21:59 ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Ley Foon Tan, Bjorn Helgaas, rfi, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_ALTERA_MSI
drivers/pci/host/Kconfig:       bool "Altera PCIe MSI feature"

...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 also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Ley Foon Tan <lftan@altera.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: rfi@lists.rocketboards.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-altera-msi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/host/pcie-altera-msi.c b/drivers/pci/host/pcie-altera-msi.c
index 99177f4ccde2..369e033449c6 100644
--- a/drivers/pci/host/pcie-altera-msi.c
+++ b/drivers/pci/host/pcie-altera-msi.c
@@ -1,4 +1,8 @@
 /*
+ * Altera PCIe MSI support
+ *
+ * Author: Ley Foon Tan <lftan@altera.com>
+ *
  * Copyright Altera Corporation (C) 2013-2015. All rights reserved
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -16,7 +20,7 @@
 
 #include <linux/interrupt.h>
 #include <linux/irqchip/chained_irq.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -308,7 +312,3 @@ static int __init altera_msi_init(void)
 	return platform_driver_register(&altera_msi_driver);
 }
 subsys_initcall(altera_msi_init);
-
-MODULE_AUTHOR("Ley Foon Tan <lftan@altera.com>");
-MODULE_DESCRIPTION("Altera PCIe MSI support");
-MODULE_LICENSE("GPL v2");
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/8] PCI: altera: make it explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
  (?)
  (?)
@ 2016-08-22 21:59 ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Ley Foon Tan, Bjorn Helgaas, rfi, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_ALTERA
drivers/pci/host/Kconfig:       bool "Altera PCIe controller"

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

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

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

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

Cc: Ley Foon Tan <lftan@altera.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: rfi@lists.rocketboards.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-altera.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
index 2b7837650db8..48f2736a10cd 100644
--- a/drivers/pci/host/pcie-altera.c
+++ b/drivers/pci/host/pcie-altera.c
@@ -1,6 +1,9 @@
 /*
  * Copyright Altera Corporation (C) 2013-2015. All rights reserved
  *
+ * Author: Ley Foon Tan <lftan@altera.com>
+ * Description: Altera PCIe host controller driver
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -17,7 +20,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/irqchip/chained_irq.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_pci.h>
@@ -568,7 +571,6 @@ static const struct of_device_id altera_pcie_of_match[] = {
 	{ .compatible = "altr,pcie-root-port-1.0", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, altera_pcie_of_match);
 
 static struct platform_driver altera_pcie_driver = {
 	.probe		= altera_pcie_probe,
@@ -583,8 +585,4 @@ static int altera_pcie_init(void)
 {
 	return platform_driver_register(&altera_pcie_driver);
 }
-module_init(altera_pcie_init);
-
-MODULE_AUTHOR("Ley Foon Tan <lftan@altera.com>");
-MODULE_DESCRIPTION("Altera PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+device_initcall(altera_pcie_init);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/8] PCI: imx6: make it explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
                   ` (2 preceding siblings ...)
  (?)
@ 2016-08-22 21:59 ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Richard Zhu, Lucas Stach, Bjorn Helgaas, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_IMX6
drivers/pci/host/Kconfig:       bool "Freescale i.MX6 PCIe controller"

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

Lets remove the couple instances of modular code usage, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

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

We don't delete module.h since the file never even had that.

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

Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-imx6.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index b741a36a67f3..ead4a5c3480b 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -739,7 +739,6 @@ static const struct of_device_id imx6_pcie_of_match[] = {
 	{ .compatible = "fsl,imx6qp-pcie", .data = (void *)IMX6QP, },
 	{},
 };
-MODULE_DEVICE_TABLE(of, imx6_pcie_of_match);
 
 static struct platform_driver imx6_pcie_driver = {
 	.driver = {
@@ -749,14 +748,8 @@ static struct platform_driver imx6_pcie_driver = {
 	.shutdown = imx6_pcie_shutdown,
 };
 
-/* Freescale PCIe driver does not allow module unload */
-
 static int __init imx6_pcie_init(void)
 {
 	return platform_driver_probe(&imx6_pcie_driver, imx6_pcie_probe);
 }
-module_init(imx6_pcie_init);
-
-MODULE_AUTHOR("Sean Cross <xobs@kosagi.com>");
-MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+device_initcall(imx6_pcie_init);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/8] PCI: portdrv: make it explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
                   ` (3 preceding siblings ...)
  (?)
@ 2016-08-22 21:59 ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Bjorn Helgaas, Tom Long Nguyen, linux-pci

The Makefile/Kconfig currently controlling compilation of this code is:

pcieportdrv-y               := portdrv_core.o portdrv_pci.o portdrv_bus.o
obj-$(CONFIG_PCIEPORTBUS)   += pcieportdrv.o

drivers/pci/pcie/Kconfig:config PCIEPORTBUS
drivers/pci/pcie/Kconfig:       bool "PCI Express Port Bus support"

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

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

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

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

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained earlier up in the file.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Tom Long Nguyen <tom.l.nguyen@intel.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/pcie/portdrv_pci.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 70d7ad8c6d17..85f7afcd6227 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -6,7 +6,6 @@
  * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
  */
 
-#include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -27,9 +26,6 @@
 #define DRIVER_VERSION "v1.0"
 #define DRIVER_AUTHOR "tom.l.nguyen@intel.com"
 #define DRIVER_DESC "PCIe Port Bus Driver"
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
 
 /* If this switch is set, PCIe port native services should not be enabled. */
 bool pcie_ports_disabled;
@@ -341,7 +337,6 @@ static const struct pci_device_id port_pci_ids[] = { {
 	PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0),
 	}, { /* end: all zeroes */ }
 };
-MODULE_DEVICE_TABLE(pci, port_pci_ids);
 
 static const struct pci_error_handlers pcie_portdrv_err_handler = {
 	.error_detected = pcie_portdrv_error_detected,
@@ -406,5 +401,4 @@ static int __init pcie_portdrv_init(void)
  out:
 	return retval;
 }
-
-module_init(pcie_portdrv_init);
+device_initcall(pcie_portdrv_init);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/8] PCI: spear13xx: make it explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
                   ` (4 preceding siblings ...)
  (?)
@ 2016-08-22 21:59 ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Pratyush Anand, Bjorn Helgaas, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_SPEAR13XX
drivers/pci/host/Kconfig:       bool "STMicroelectronics SPEAr PCIe controller"

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

Lets remove the couple instances of modular code usage, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

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

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

Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-spear13xx.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c
index a4060b85ab23..09aed85f275a 100644
--- a/drivers/pci/host/pcie-spear13xx.c
+++ b/drivers/pci/host/pcie-spear13xx.c
@@ -15,7 +15,7 @@
 #include <linux/clk.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/pci.h>
 #include <linux/phy/phy.h>
@@ -355,7 +355,6 @@ static const struct of_device_id spear13xx_pcie_of_match[] = {
 	{ .compatible = "st,spear1340-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match);
 
 static struct platform_driver spear13xx_pcie_driver = {
 	.probe		= spear13xx_pcie_probe,
@@ -365,14 +364,8 @@ static struct platform_driver spear13xx_pcie_driver = {
 	},
 };
 
-/* SPEAr13xx PCIe driver does not allow module unload */
-
 static int __init spear13xx_pcie_init(void)
 {
 	return platform_driver_register(&spear13xx_pcie_driver);
 }
-module_init(spear13xx_pcie_init);
-
-MODULE_DESCRIPTION("ST Microelectronics SPEAr13xx PCIe host controller driver");
-MODULE_AUTHOR("Pratyush Anand <pratyush.anand@gmail.com>");
-MODULE_LICENSE("GPL v2");
+device_initcall(spear13xx_pcie_init);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/8] PCI: designware: make host support explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
                   ` (5 preceding siblings ...)
  (?)
@ 2016-08-22 21:59 ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Jingoo Han, Pratyush Anand, Bjorn Helgaas, linux-pci

The Kconfig entry controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_DW
drivers/pci/host/Kconfig:       bool

...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 end up adding init.h to this file, since it isn't actually
using __init or any initcalls directly.

Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-designware.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 12afce19890b..16374202cb8b 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -14,7 +14,6 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
@@ -802,7 +801,3 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
 	val |= PORT_LOGIC_SPEED_CHANGE;
 	dw_pcie_wr_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, val);
 }
-
-MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
-MODULE_DESCRIPTION("Designware PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 7/8] PCI: exynos: make host support explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
@ 2016-08-22 21:59   ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Jingoo Han, Bjorn Helgaas, Kukjin Kim,
	Krzysztof Kozlowski, linux-pci, linux-samsung-soc

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_EXYNOS
drivers/pci/host/Kconfig:       bool "Samsung Exynos PCIe controller"

...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.

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

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

Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-exynos.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c
index 219976103efc..c3ae9c7a6e33 100644
--- a/drivers/pci/host/pci-exynos.c
+++ b/drivers/pci/host/pci-exynos.c
@@ -16,7 +16,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -624,7 +624,6 @@ static const struct of_device_id exynos_pcie_of_match[] = {
 	{ .compatible = "samsung,exynos5440-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, exynos_pcie_of_match);
 
 static struct platform_driver exynos_pcie_driver = {
 	.remove		= __exit_p(exynos_pcie_remove),
@@ -641,7 +640,3 @@ static int __init exynos_pcie_init(void)
 	return platform_driver_probe(&exynos_pcie_driver, exynos_pcie_probe);
 }
 subsys_initcall(exynos_pcie_init);
-
-MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
-MODULE_DESCRIPTION("Samsung PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 7/8] PCI: exynos: make host support explicitly non-modular
@ 2016-08-22 21:59   ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Jingoo Han, Bjorn Helgaas, Kukjin Kim,
	Krzysztof Kozlowski, linux-pci, linux-samsung-soc

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_EXYNOS
drivers/pci/host/Kconfig:       bool "Samsung Exynos PCIe controller"

...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.

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

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

Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-exynos.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c
index 219976103efc..c3ae9c7a6e33 100644
--- a/drivers/pci/host/pci-exynos.c
+++ b/drivers/pci/host/pci-exynos.c
@@ -16,7 +16,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -624,7 +624,6 @@ static const struct of_device_id exynos_pcie_of_match[] = {
 	{ .compatible = "samsung,exynos5440-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, exynos_pcie_of_match);
 
 static struct platform_driver exynos_pcie_driver = {
 	.remove		= __exit_p(exynos_pcie_remove),
@@ -641,7 +640,3 @@ static int __init exynos_pcie_init(void)
 	return platform_driver_probe(&exynos_pcie_driver, exynos_pcie_probe);
 }
 subsys_initcall(exynos_pcie_init);
-
-MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
-MODULE_DESCRIPTION("Samsung PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 8/8] PCI: generic: make host-common explicitly non-modular
  2016-08-22 21:59 ` Paul Gortmaker
                   ` (7 preceding siblings ...)
  (?)
@ 2016-08-22 21:59 ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2016-08-22 21:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Will Deacon, Bjorn Helgaas, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_COMMON
drivers/pci/host/Kconfig:       bool

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

Lets remove the couple trivial modular references, so that when reading
the code there is no doubt it is builtin-only.

There are no modular init calls in this code, so no init ordering
issues to be concerned with here.

We don't replace module.h with init.h since the file does not have
any functions marked with the __init prefix.

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.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-host-common.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/host/pci-host-common.c b/drivers/pci/host/pci-host-common.c
index 9d9d34e959b6..946382fd4ea1 100644
--- a/drivers/pci/host/pci-host-common.c
+++ b/drivers/pci/host/pci-host-common.c
@@ -1,4 +1,6 @@
 /*
+ * Generic PCI host driver common code
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -17,7 +19,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/pci-ecam.h>
@@ -162,7 +163,3 @@ int pci_host_common_probe(struct platform_device *pdev,
 	pci_bus_add_devices(bus);
 	return 0;
 }
-
-MODULE_DESCRIPTION("Generic PCI host driver common code");
-MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
-MODULE_LICENSE("GPL v2");
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/8] PCI: more trivial demodularization of builtin code
  2016-08-22 21:59 ` Paul Gortmaker
                   ` (8 preceding siblings ...)
  (?)
@ 2016-08-23 20:48 ` Bjorn Helgaas
  -1 siblings, 0 replies; 13+ messages in thread
From: Bjorn Helgaas @ 2016-08-23 20:48 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Bjorn Helgaas, Jingoo Han, Krzysztof Kozlowski,
	Kukjin Kim, Ley Foon Tan, Lucas Stach, Pratyush Anand,
	Richard Zhu, Tom Long Nguyen, Will Deacon, rfi, linux-pci,
	linux-samsung-soc

On Mon, Aug 22, 2016 at 05:59:40PM -0400, Paul Gortmaker wrote:
> This is another group of commits that was chosen since they really don't
> change anything even at a binary object file level ; they just replace
> module_init with device_initcall (which are identical), and remove some
> MODULE_<blah> tags that are no-ops in code.  So the run time regression
> risk is zero here.
> 
> More specifically, we are doing the following to these PCI files that
> currently can only be built-in:
> 
>  -- remove the include of module.h ; replace it with init.h as req'd
> 
>  -- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in.
> 
>  -- replace module_init (if present) with device_initcall, which is
>     functionally identical once CPP has processed the source.
> 
>  -- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION
>     while ensuring the contained info is present in the file comments.
> 
> Build tested for allmodconfig on several arch, including ARM and ARM-64
> on a recent linux-next baseline.
> 
> Some non-modular PCI files still remain with unused __exit and/or .remove
> functions.  Those will be dealt with in a separate series after this.
> 
> Also note that we looked into modularizing some of the PCI_DW stuff at
> an earlier time[1] but that ran into problems such as trying to create
> unwind for hook_fault_code etc. that wasn't easily solved.  So we just
> go with keeping the code runtime functionally equivalent to what it was.
> 
> Paul.
> 
> [1] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortmaker@windriver.com
> 
> ---
> 
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Ley Foon Tan <lftan@altera.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Pratyush Anand <pratyush.anand@gmail.com>
> Cc: Richard Zhu <Richard.Zhu@freescale.com>
> Cc: Tom Long Nguyen <tom.l.nguyen@intel.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: rfi@lists.rocketboards.org
> Cc: linux-pci@vger.kernel.org
> Cc: linux-samsung-soc@vger.kernel.org
> 
> Paul Gortmaker (8):
>   PCI: altera: make msi explicitly non-modular
>   PCI: altera: make it explicitly non-modular
>   PCI: imx6: make it explicitly non-modular
>   PCI: portdrv: make it explicitly non-modular
>   PCI: spear13xx: make it explicitly non-modular
>   PCI: designware: make host support explicitly non-modular
>   PCI: exynos: make host support explicitly non-modular
>   PCI: generic: make host-common explicitly non-modular
> 
>  drivers/pci/host/pci-exynos.c      |  7 +------
>  drivers/pci/host/pci-host-common.c |  7 ++-----
>  drivers/pci/host/pci-imx6.c        |  9 +--------
>  drivers/pci/host/pcie-altera-msi.c | 10 +++++-----
>  drivers/pci/host/pcie-altera.c     | 12 +++++-------
>  drivers/pci/host/pcie-designware.c |  5 -----
>  drivers/pci/host/pcie-spear13xx.c  | 11 ++---------
>  drivers/pci/pcie/portdrv_pci.c     |  8 +-------
>  8 files changed, 17 insertions(+), 52 deletions(-)

I applied all these to pci/demodularize for v4.9, thanks, Paul!

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 7/8] PCI: exynos: make host support explicitly non-modular
  2016-08-22 21:59   ` Paul Gortmaker
  (?)
@ 2016-08-24 19:15   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2016-08-24 19:15 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Jingoo Han, Bjorn Helgaas, Kukjin Kim,
	Krzysztof Kozlowski, linux-pci, linux-samsung-soc

On Mon, Aug 22, 2016 at 05:59:47PM -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_EXYNOS
> drivers/pci/host/Kconfig:       bool "Samsung Exynos PCIe controller"
> 
> ...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.
> 
> Note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
> 
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-samsung-soc@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pci-exynos.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-08-24 19:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-22 21:59 [PATCH 0/8] PCI: more trivial demodularization of builtin code Paul Gortmaker
2016-08-22 21:59 ` Paul Gortmaker
2016-08-22 21:59 ` [PATCH 1/8] PCI: altera: make msi explicitly non-modular Paul Gortmaker
2016-08-22 21:59 ` [PATCH 2/8] PCI: altera: make it " Paul Gortmaker
2016-08-22 21:59 ` [PATCH 3/8] PCI: imx6: " Paul Gortmaker
2016-08-22 21:59 ` [PATCH 4/8] PCI: portdrv: " Paul Gortmaker
2016-08-22 21:59 ` [PATCH 5/8] PCI: spear13xx: " Paul Gortmaker
2016-08-22 21:59 ` [PATCH 6/8] PCI: designware: make host support " Paul Gortmaker
2016-08-22 21:59 ` [PATCH 7/8] PCI: exynos: " Paul Gortmaker
2016-08-22 21:59   ` Paul Gortmaker
2016-08-24 19:15   ` Krzysztof Kozlowski
2016-08-22 21:59 ` [PATCH 8/8] PCI: generic: make host-common " Paul Gortmaker
2016-08-23 20:48 ` [PATCH 0/8] PCI: more trivial demodularization of builtin code Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.