mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	"David Vrabel" <david.vrabel@citrix.com>,
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/5] drivers/xen: make [xen-]ballon explicitly non-modular
Date: Mon, 15 Feb 2016 11:49:34 +0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1602151104440.27008@kaball.uk.xensource.com> (raw)
In-Reply-To: <1455481970-15239-3-git-send-email-paul.gortmaker@windriver.com>

[-- Attachment #1: Type: text/plain, Size: 3379 bytes --]

On Sun, 14 Feb 2016, Paul Gortmaker wrote:
> The Makefile / Kconfig currently controlling compilation here is:
> 
> obj-y   += grant-table.o features.o balloon.o manage.o preempt.o time.o
> [...]
> obj-$(CONFIG_XEN_BALLOON)               += xen-balloon.o
> 
> ...with:
> 
> drivers/xen/Kconfig:config XEN_BALLOON
> drivers/xen/Kconfig:    bool "Xen memory balloon driver"
> 
> ...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.
> 
> In doing so we uncover two implict includes that were obtained
> by module.h having such a wide include scope itself:
> 
> In file included from drivers/xen/xen-balloon.c:41:0:
> include/xen/balloon.h:26:51: warning: ‘struct page’ declared inside parameter list [enabled by default]
>  int alloc_xenballooned_pages(int nr_pages, struct page **pages);
>                                                    ^
> include/xen/balloon.h: In function ‘register_xen_selfballooning’:
> include/xen/balloon.h:35:10: error: ‘ENOSYS’ undeclared (first use in this function)
>   return -ENOSYS;
>           ^
> 
> This is fixed by adding mm-types.h and errno.h to the list.
> 
> We also delete the MODULE_LICENSE tags 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/balloon.c     |  4 ----
>  drivers/xen/xen-balloon.c | 14 +++-----------
>  2 files changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
> index 7c8a2cf16f58..9781e0dd59d6 100644
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -42,7 +42,6 @@
>  #include <linux/kernel.h>
>  #include <linux/sched.h>
>  #include <linux/errno.h>
> -#include <linux/module.h>
>  #include <linux/mm.h>
>  #include <linux/bootmem.h>
>  #include <linux/pagemap.h>
> @@ -760,7 +759,4 @@ static int __init balloon_init(void)
>  
>  	return 0;
>  }
> -
>  subsys_initcall(balloon_init);
> -
> -MODULE_LICENSE("GPL");
> diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c
> index 39e7ef8d3957..79865b8901ba 100644
> --- a/drivers/xen/xen-balloon.c
> +++ b/drivers/xen/xen-balloon.c
> @@ -33,7 +33,9 @@
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
>  #include <linux/kernel.h>
> -#include <linux/module.h>
> +#include <linux/errno.h>
> +#include <linux/mm_types.h>
> +#include <linux/init.h>
>  #include <linux/capability.h>
>  
>  #include <xen/xen.h>
> @@ -109,14 +111,6 @@ static int __init balloon_init(void)
>  }
>  subsys_initcall(balloon_init);
>  
> -static void balloon_exit(void)
> -{
> -    /* XXX - release balloon here */
> -    return;
> -}
> -
> -module_exit(balloon_exit);
> -
>  #define BALLOON_SHOW(name, format, args...)				\
>  	static ssize_t show_##name(struct device *dev,			\
>  				   struct device_attribute *attr,	\
> @@ -250,5 +244,3 @@ static int register_balloon(struct device *dev)
>  
>  	return 0;
>  }
> -
> -MODULE_LICENSE("GPL");
> -- 
> 2.6.1
> 

  reply	other threads:[~2016-02-15 11:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-14 20:32 [PATCH 0/5] xen: avoid module usage in non-modular code Paul Gortmaker
2016-02-14 20:32 ` [PATCH 1/5] xen: audit usages of module.h ; remove unnecessary instances Paul Gortmaker
2016-02-15 11:44   ` Stefano Stabellini
2016-02-14 20:32 ` [PATCH 2/5] drivers/xen: make [xen-]ballon explicitly non-modular Paul Gortmaker
2016-02-15 11:49   ` Stefano Stabellini [this message]
2016-02-14 20:32 ` [PATCH 3/5] drivers/xen: make xenbus_dev_[front/back]end " Paul Gortmaker
2016-02-15 11:53   ` [Xen-devel] " Stefano Stabellini
2016-02-14 20:32 ` [PATCH 4/5] drivers/xen: make sys-hypervisor.c " Paul Gortmaker
2016-02-15 11:54   ` Stefano Stabellini
2016-02-14 20:32 ` [PATCH 5/5] drivers/xen: make platform-pci.c " Paul Gortmaker
2016-02-15 11:55   ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1602151104440.27008@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®