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


Groups > linux.kernel > #1334419

Re: [Xen-devel] [PATCH 3/5] drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular

From Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Newsgroups linux.kernel
Subject Re: [Xen-devel] [PATCH 3/5] drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular
Date 2016-02-15 13:00 +0100
Message-ID <r2pYS-ou-5@gated-at.bofh.it> (permalink)
References <r2bCy-7Mr-13@gated-at.bofh.it> <r2bCy-7Mr-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, 14 Feb 2016, Paul Gortmaker wrote:
> The Makefile / Kconfig currently controlling compilation here is:
> 
> obj-y   += xenbus_dev_frontend.o
> [...]
> obj-$(CONFIG_XEN_BACKEND) += xenbus_dev_backend.o
> 
> ...with:
> 
> drivers/xen/Kconfig:config XEN_BACKEND
> drivers/xen/Kconfig:    bool "Backend driver support"
> 
> ...meaning that they currently are not being built as modules 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 also delete the MODULE_LICENSE tag since all that information
> is already 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>

Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  drivers/xen/xenbus/xenbus_dev_backend.c  | 13 ++-----------
>  drivers/xen/xenbus/xenbus_dev_frontend.c | 13 ++-----------
>  2 files changed, 4 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/xen/xenbus/xenbus_dev_backend.c b/drivers/xen/xenbus/xenbus_dev_backend.c
> index ee6d9efd7b76..4a41ac9af966 100644
> --- a/drivers/xen/xenbus/xenbus_dev_backend.c
> +++ b/drivers/xen/xenbus/xenbus_dev_backend.c
> @@ -5,7 +5,7 @@
>  #include <linux/mm.h>
>  #include <linux/fs.h>
>  #include <linux/miscdevice.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/capability.h>
>  
>  #include <xen/xen.h>
> @@ -18,8 +18,6 @@
>  
>  #include "xenbus_comms.h"
>  
> -MODULE_LICENSE("GPL");
> -
>  static int xenbus_backend_open(struct inode *inode, struct file *filp)
>  {
>  	if (!capable(CAP_SYS_ADMIN))
> @@ -132,11 +130,4 @@ static int __init xenbus_backend_init(void)
>  		pr_err("Could not register xenbus backend device\n");
>  	return err;
>  }
> -
> -static void __exit xenbus_backend_exit(void)
> -{
> -	misc_deregister(&xenbus_backend_dev);
> -}
> -
> -module_init(xenbus_backend_init);
> -module_exit(xenbus_backend_exit);
> +device_initcall(xenbus_backend_init);
> diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
> index 9433e46518c8..8c0a359ab4a8 100644
> --- a/drivers/xen/xenbus/xenbus_dev_frontend.c
> +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
> @@ -55,7 +55,7 @@
>  #include <linux/string.h>
>  #include <linux/slab.h>
>  #include <linux/miscdevice.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  
>  #include "xenbus_comms.h"
>  
> @@ -63,8 +63,6 @@
>  #include <xen/xen.h>
>  #include <asm/xen/hypervisor.h>
>  
> -MODULE_LICENSE("GPL");
> -
>  /*
>   * An element of a list of outstanding transactions, for which we're
>   * still waiting a reply.
> @@ -624,11 +622,4 @@ static int __init xenbus_init(void)
>  		pr_err("Could not register xenbus frontend device\n");
>  	return err;
>  }
> -
> -static void __exit xenbus_exit(void)
> -{
> -	misc_deregister(&xenbus_dev);
> -}
> -
> -module_init(xenbus_init);
> -module_exit(xenbus_exit);
> +device_initcall(xenbus_init);
> -- 
> 2.6.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] xen: avoid module usage in non-modular code Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-14 21:40 +0100
  [PATCH 2/5] drivers/xen: make [xen-]ballon explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-14 21:40 +0100
    Re: [PATCH 2/5] drivers/xen: make [xen-]ballon explicitly  non-modular Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-15 13:00 +0100
  [PATCH 4/5] drivers/xen: make sys-hypervisor.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-14 21:40 +0100
    Re: [PATCH 4/5] drivers/xen: make sys-hypervisor.c explicitly  non-modular Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-15 13:00 +0100
  [PATCH 3/5] drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-14 21:40 +0100
    Re: [Xen-devel] [PATCH 3/5] drivers/xen: make xenbus_dev_[front/back]end  explicitly non-modular Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-15 13:00 +0100
  [PATCH 1/5] xen: audit usages of module.h ; remove unnecessary instances Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-02-14 21:40 +0100
    Re: [PATCH 1/5] xen: audit usages of module.h ; remove unnecessary  instances Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-15 12:50 +0100

csiph-web