Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1333555 > unrolled thread

[PATCH 5/5] drivers/xen: make platform-pci.c explicitly non-modular

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2016-02-14 21:40 +0100
Last post2016-02-15 13:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/5] drivers/xen: make platform-pci.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-14 21:40 +0100
    Re: [PATCH 5/5] drivers/xen: make platform-pci.c explicitly  non-modular Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-15 13:00 +0100

#1333555 — [PATCH 5/5] drivers/xen: make platform-pci.c explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-02-14 21:40 +0100
Subject[PATCH 5/5] drivers/xen: make platform-pci.c explicitly non-modular
Message-ID<r2bCy-7Mr-15@gated-at.bofh.it>
The Kconfig currently controlling compilation of this code is:

arch/x86/xen/Kconfig:config XEN_PVHVM
arch/x86/xen/Kconfig:   def_bool y

...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: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/xen/platform-pci.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 3454973dc3bb..302232518c98 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -2,6 +2,9 @@
  * platform-pci.c
  *
  * Xen platform PCI device driver
+ *
+ * Authors: ssmith@xensource.com and stefano.stabellini@eu.citrix.com
+ *
  * Copyright (c) 2005, Intel Corporation.
  * Copyright (c) 2007, XenSource Inc.
  * Copyright (c) 2010, Citrix
@@ -24,7 +27,7 @@
 
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/pci.h>
 
 #include <xen/platform_pci.h>
@@ -36,10 +39,6 @@
 
 #define DRV_NAME    "xen-platform-pci"
 
-MODULE_AUTHOR("ssmith@xensource.com and stefano.stabellini@eu.citrix.com");
-MODULE_DESCRIPTION("Xen platform PCI device");
-MODULE_LICENSE("GPL");
-
 static unsigned long platform_mmio;
 static unsigned long platform_mmio_alloc;
 static unsigned long platform_mmiolen;
@@ -181,8 +180,6 @@ static struct pci_device_id platform_pci_tbl[] = {
 	{0,}
 };
 
-MODULE_DEVICE_TABLE(pci, platform_pci_tbl);
-
 static struct pci_driver platform_driver = {
 	.name =           DRV_NAME,
 	.probe =          platform_pci_init,
@@ -192,9 +189,8 @@ static struct pci_driver platform_driver = {
 #endif
 };
 
-static int __init platform_pci_module_init(void)
+static int __init platform_pci_xen_init(void)
 {
 	return pci_register_driver(&platform_driver);
 }
-
-module_init(platform_pci_module_init);
+device_initcall(platform_pci_xen_init);
-- 
2.6.1

[toc] | [next] | [standalone]


#1334420 — Re: [PATCH 5/5] drivers/xen: make platform-pci.c explicitly non-modular

FromStefano Stabellini <stefano.stabellini@eu.citrix.com>
Date2016-02-15 13:00 +0100
SubjectRe: [PATCH 5/5] drivers/xen: make platform-pci.c explicitly non-modular
Message-ID<r2pYS-ou-7@gated-at.bofh.it>
In reply to#1333555
On Sun, 14 Feb 2016, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> arch/x86/xen/Kconfig:config XEN_PVHVM
> arch/x86/xen/Kconfig:   def_bool y
> 
> ...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: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/xen/platform-pci.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
> index 3454973dc3bb..302232518c98 100644
> --- a/drivers/xen/platform-pci.c
> +++ b/drivers/xen/platform-pci.c
> @@ -2,6 +2,9 @@
>   * platform-pci.c
>   *
>   * Xen platform PCI device driver
> + *
> + * Authors: ssmith@xensource.com and stefano.stabellini@eu.citrix.com
> + *
>   * Copyright (c) 2005, Intel Corporation.
>   * Copyright (c) 2007, XenSource Inc.
>   * Copyright (c) 2010, Citrix
> @@ -24,7 +27,7 @@
>  
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/pci.h>
>  
>  #include <xen/platform_pci.h>
> @@ -36,10 +39,6 @@
>  
>  #define DRV_NAME    "xen-platform-pci"
>  
> -MODULE_AUTHOR("ssmith@xensource.com and stefano.stabellini@eu.citrix.com");
> -MODULE_DESCRIPTION("Xen platform PCI device");
> -MODULE_LICENSE("GPL");
> -
>  static unsigned long platform_mmio;
>  static unsigned long platform_mmio_alloc;
>  static unsigned long platform_mmiolen;
> @@ -181,8 +180,6 @@ static struct pci_device_id platform_pci_tbl[] = {
>  	{0,}
>  };
>  
> -MODULE_DEVICE_TABLE(pci, platform_pci_tbl);
> -
>  static struct pci_driver platform_driver = {
>  	.name =           DRV_NAME,
>  	.probe =          platform_pci_init,
> @@ -192,9 +189,8 @@ static struct pci_driver platform_driver = {
>  #endif
>  };
>  
> -static int __init platform_pci_module_init(void)
> +static int __init platform_pci_xen_init(void)

Maybe platform_pci_register? Or rename platform_pci_init to
platform_pci_probe and this to platform_pci_init.


>  {
>  	return pci_register_driver(&platform_driver);
>  }
> -
> -module_init(platform_pci_module_init);
> +device_initcall(platform_pci_xen_init);
> -- 
> 2.6.1
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web