Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/xen: make [xen-]ballon explicitly non-modular

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.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>

authored by

Paul Gortmaker and committed by
David Vrabel
106eaa8e 59aa56bf

+3 -15
-4
drivers/xen/balloon.c
··· 42 42 #include <linux/kernel.h> 43 43 #include <linux/sched.h> 44 44 #include <linux/errno.h> 45 - #include <linux/module.h> 46 45 #include <linux/mm.h> 47 46 #include <linux/bootmem.h> 48 47 #include <linux/pagemap.h> ··· 750 751 751 752 return 0; 752 753 } 753 - 754 754 subsys_initcall(balloon_init); 755 - 756 - MODULE_LICENSE("GPL");
+3 -11
drivers/xen/xen-balloon.c
··· 33 33 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 34 34 35 35 #include <linux/kernel.h> 36 - #include <linux/module.h> 36 + #include <linux/errno.h> 37 + #include <linux/mm_types.h> 38 + #include <linux/init.h> 37 39 #include <linux/capability.h> 38 40 39 41 #include <xen/xen.h> ··· 110 108 return 0; 111 109 } 112 110 subsys_initcall(balloon_init); 113 - 114 - static void balloon_exit(void) 115 - { 116 - /* XXX - release balloon here */ 117 - return; 118 - } 119 - 120 - module_exit(balloon_exit); 121 111 122 112 #define BALLOON_SHOW(name, format, args...) \ 123 113 static ssize_t show_##name(struct device *dev, \ ··· 244 250 245 251 return 0; 246 252 } 247 - 248 - MODULE_LICENSE("GPL");