[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/2] force inclusion of xen/config.h through compiler option



As we expect all source files to include the header as the first thing
anyway, stop doing this by repeating the inclusion in each and every
source file (and in many headers), but rather enforce this uniformly
through the compiler command line.

As a first cleanup step, remove the explicit inclusion from all common
headers. Further cleanup can be done incrementally.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -41,7 +41,7 @@ ALL_OBJS-y               += $(BASEDIR)/x
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS-y                += -g -D__XEN__
+CFLAGS-y                += -g -D__XEN__ --include 
$(BASEDIR)/include/xen/config.h
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c
 CFLAGS-$(FLASK_ENABLE)  += -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS
@@ -59,7 +59,7 @@ ifneq ($(max_phys_irqs),)
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
 
-AFLAGS-y                += -D__ASSEMBLY__
+AFLAGS-y                += -D__ASSEMBLY__ --include 
$(BASEDIR)/include/xen/config.h
 
 # Clang's built-in assembler can't handle .code16/.code32/.code64 yet
 AFLAGS-$(clang)         += -no-integrated-as
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -3,7 +3,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/bitops.h>
--- a/xen/include/xen/byteorder/swab.h
+++ b/xen/include/xen/byteorder/swab.h
@@ -10,8 +10,6 @@
  *    to clean up support for bizarre-endian architectures.
  */
 
-#include <xen/compiler.h>
-
 /* casts are necessary for constants, because we never know how for sure
  * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
  */
--- a/xen/include/xen/cache.h
+++ b/xen/include/xen/cache.h
@@ -1,7 +1,6 @@
 #ifndef __LINUX_CACHE_H
 #define __LINUX_CACHE_H
 
-#include <xen/config.h>
 #include <asm/cache.h>
 
 #ifndef L1_CACHE_ALIGN
--- a/xen/include/xen/compat.h
+++ b/xen/include/xen/compat.h
@@ -5,8 +5,6 @@
 #ifndef __XEN_COMPAT_H__
 #define __XEN_COMPAT_H__
 
-#include <xen/config.h>
-
 #ifdef CONFIG_COMPAT
 
 #include <xen/types.h>
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -75,7 +75,6 @@
  *    inside a macro, the way we do the other calls.
  */
 
-#include <xen/config.h>
 #include <xen/bitmap.h>
 #include <xen/kernel.h>
 
--- a/xen/include/xen/ctype.h
+++ b/xen/include/xen/ctype.h
@@ -1,8 +1,6 @@
 #ifndef _LINUX_CTYPE_H
 #define _LINUX_CTYPE_H
 
-#include <xen/config.h>
-
 /*
  * NOTE! This ctype does not handle EOF like the standard C
  * library is required to.
--- a/xen/include/xen/domain_page.h
+++ b/xen/include/xen/domain_page.h
@@ -9,7 +9,6 @@
 #ifndef __XEN_DOMAIN_PAGE_H__
 #define __XEN_DOMAIN_PAGE_H__
 
-#include <xen/config.h>
 #include <xen/mm.h>
 
 #ifdef CONFIG_DOMAIN_PAGE
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -9,7 +9,6 @@
 #ifndef __XEN_EVENT_H__
 #define __XEN_EVENT_H__
 
-#include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -24,7 +24,6 @@
 #ifndef __XEN_GRANT_TABLE_H__
 #define __XEN_GRANT_TABLE_H__
 
-#include <xen/config.h>
 #include <public/grant_table.h>
 #include <asm/grant_table.h>
 
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -5,7 +5,6 @@
 #ifndef __XEN_HYPERCALL_H__
 #define __XEN_HYPERCALL_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/time.h>
 #include <public/xen.h>
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -1,7 +1,6 @@
 #ifndef _LINUX_INIT_H
 #define _LINUX_INIT_H
 
-#include <xen/config.h>
 #include <asm/init.h>
 
 /*
--- a/xen/include/xen/inttypes.h
+++ b/xen/include/xen/inttypes.h
@@ -23,7 +23,6 @@
 #ifndef _XEN_INTTYPES_H
 #define _XEN_INTTYPES_H        1
 
-#include <xen/config.h>
 #include <xen/types.h>
 
 # if BITS_PER_LONG == 64
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -1,7 +1,6 @@
 #ifndef __XEN_IRQ_H__
 #define __XEN_IRQ_H__
 
-#include <xen/config.h>
 #include <xen/cpumask.h>
 #include <xen/rcupdate.h>
 #include <xen/spinlock.h>
--- a/xen/include/xen/irq_cpustat.h
+++ b/xen/include/xen/irq_cpustat.h
@@ -9,7 +9,6 @@
  * Keith Owens <kaos@xxxxxxxxxx> July 2000.
  */
 
-#include <xen/config.h>
 #include <asm/hardirq.h>
 
 /*
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -3,7 +3,6 @@
 
 #include <xen/inttypes.h>
 #include <xen/stdarg.h>
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/string.h>
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -28,7 +28,6 @@
 #ifndef __XEN_MM_H__
 #define __XEN_MM_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
--- a/xen/include/xen/notifier.h
+++ b/xen/include/xen/notifier.h
@@ -10,7 +10,6 @@
 #ifndef __XEN_NOTIFIER_H__
 #define __XEN_NOTIFIER_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/kernel.h>
--- a/xen/include/xen/numa.h
+++ b/xen/include/xen/numa.h
@@ -1,7 +1,6 @@
 #ifndef _XEN_NUMA_H
 #define _XEN_NUMA_H
 
-#include <xen/config.h>
 #include <asm/numa.h>
 
 #ifndef NODES_SHIFT
--- a/xen/include/xen/paging.h
+++ b/xen/include/xen/paging.h
@@ -2,8 +2,6 @@
 #ifndef __XEN_PAGING_H__
 #define __XEN_PAGING_H__
 
-#include <xen/config.h>
-
 #if defined CONFIG_PAGING_ASSISTANCE
 
 #include <asm/paging.h>
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -7,7 +7,6 @@
 #ifndef __XEN_PCI_H__
 #define __XEN_PCI_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
--- a/xen/include/xen/percpu.h
+++ b/xen/include/xen/percpu.h
@@ -1,7 +1,6 @@
 #ifndef __XEN_PERCPU_H__
 #define __XEN_PERCPU_H__
 
-#include <xen/config.h>
 #include <asm/percpu.h>
 
 /*
--- a/xen/include/xen/preempt.h
+++ b/xen/include/xen/preempt.h
@@ -9,7 +9,6 @@
 #ifndef __XEN_PREEMPT_H__
 #define __XEN_PREEMPT_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/percpu.h>
 
--- a/xen/include/xen/radix-tree.h
+++ b/xen/include/xen/radix-tree.h
@@ -20,7 +20,6 @@
 #ifndef _XEN_RADIX_TREE_H
 #define _XEN_RADIX_TREE_H
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/rcupdate.h>
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -2,7 +2,6 @@
 #ifndef __SCHED_H__
 #define __SCHED_H__
 
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
 #include <xen/shared.h>
--- a/xen/include/xen/shared.h
+++ b/xen/include/xen/shared.h
@@ -1,8 +1,6 @@
 #ifndef __XEN_SHARED_H__
 #define __XEN_SHARED_H__
 
-#include <xen/config.h>
-
 #ifdef CONFIG_COMPAT
 
 #include <compat/xen.h>
--- a/xen/include/xen/smp.h
+++ b/xen/include/xen/smp.h
@@ -1,7 +1,6 @@
 #ifndef __XEN_SMP_H__
 #define __XEN_SMP_H__
 
-#include <xen/config.h>
 #include <asm/smp.h>
 
 /*
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -11,7 +11,6 @@ enum {
     NR_COMMON_SOFTIRQS
 };
 
-#include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/smp.h>
 #include <asm/bitops.h>
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -1,7 +1,6 @@
 #ifndef __SPINLOCK_H__
 #define __SPINLOCK_H__
 
-#include <xen/config.h>
 #include <asm/system.h>
 #include <asm/spinlock.h>
 
--- a/xen/include/xen/symbols.h
+++ b/xen/include/xen/symbols.h
@@ -1,7 +1,6 @@
 #ifndef _XEN_SYMBOLS_H
 #define _XEN_SYMBOLS_H
 
-#include <xen/config.h>
 #include <xen/types.h>
 
 #define KSYM_NAME_LEN 127
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -9,7 +9,6 @@
 #ifndef __XEN_TMEM_XEN_H__
 #define __XEN_TMEM_XEN_H__
 
-#include <xen/config.h>
 #include <xen/mm.h> /* heap alloc/free */
 #include <xen/xmalloc.h> /* xmalloc/xfree */
 #include <xen/sched.h>  /* struct domain */
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -23,7 +23,6 @@
 
 extern int tb_init_done;
 
-#include <xen/config.h>
 #include <public/sysctl.h>
 #include <public/trace.h>
 #include <asm/trace.h>
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -1,7 +1,6 @@
 #ifndef __TYPES_H__
 #define __TYPES_H__
 
-#include <xen/config.h>
 #include <asm/types.h>
 
 #define BITS_TO_LONGS(bits) \
--- a/xen/include/xen/vga.h
+++ b/xen/include/xen/vga.h
@@ -9,7 +9,6 @@
 #ifndef _XEN_VGA_H
 #define _XEN_VGA_H
 
-#include <xen/config.h>
 #include <public/xen.h>
 
 #ifdef CONFIG_VGA
--- a/xen/include/xen/xenoprof.h
+++ b/xen/include/xen/xenoprof.h
@@ -10,7 +10,6 @@
 #ifndef __XEN_XENOPROF_H__
 #define __XEN_XENOPROF_H__
 
-#include <xen/config.h>
 #include <xen/inttypes.h>
 #include <public/xenoprof.h>
 #include <asm/xenoprof.h>


Attachment: force-include-config-h.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.