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 --- 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 #include #include #include --- 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 - /* 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 #include #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 - #ifdef CONFIG_COMPAT #include --- 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 #include #include --- 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 - /* * 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 #include #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 #include #include #include --- 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 #include #include --- 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 #include #include #include --- 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 #include /* --- 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 #include # 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 #include #include #include --- a/xen/include/xen/irq_cpustat.h +++ b/xen/include/xen/irq_cpustat.h @@ -9,7 +9,6 @@ * Keith Owens July 2000. */ -#include #include /* --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -3,7 +3,6 @@ #include #include -#include #include #include #include --- 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 #include #include #include --- 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 #include #include #include --- 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 #include #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 - #if defined CONFIG_PAGING_ASSISTANCE #include --- 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 #include #include #include --- 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 #include /* --- 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 #include #include --- 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 #include #include #include --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -2,7 +2,6 @@ #ifndef __SCHED_H__ #define __SCHED_H__ -#include #include #include #include --- 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 - #ifdef CONFIG_COMPAT #include --- 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 #include /* --- a/xen/include/xen/softirq.h +++ b/xen/include/xen/softirq.h @@ -11,7 +11,6 @@ enum { NR_COMMON_SOFTIRQS }; -#include #include #include #include --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -1,7 +1,6 @@ #ifndef __SPINLOCK_H__ #define __SPINLOCK_H__ -#include #include #include --- 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 #include #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 #include /* heap alloc/free */ #include /* xmalloc/xfree */ #include /* struct domain */ --- a/xen/include/xen/trace.h +++ b/xen/include/xen/trace.h @@ -23,7 +23,6 @@ extern int tb_init_done; -#include #include #include #include --- a/xen/include/xen/types.h +++ b/xen/include/xen/types.h @@ -1,7 +1,6 @@ #ifndef __TYPES_H__ #define __TYPES_H__ -#include #include #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 #include #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 #include #include #include