Re: [PATCH 1/1] xen: asm/io.h should not include xen.h if XEN is disabled

From: Linus Torvalds
Date: Wed Aug 03 2011 - 21:05:06 EST


On Wed, Aug 3, 2011 at 6:33 AM, Dmitry Kasatkin
<dmitry.kasatkin@xxxxxxxxx> wrote:
>
> XEN related content is behind the CONFIG_XEN flag in the io.h.
> And <xen/xen.h> should be also behind CONFIG_XEN flag.

Wouldn't it be much nicer to just move the '#include <xen/xen.h>' line down?

Does the attached patch work for you?

Linus
arch/x86/include/asm/io.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index d02804d650c4..d8e8eefbe24c 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -40,8 +40,6 @@
#include <linux/compiler.h>
#include <asm/page.h>

-#include <xen/xen.h>
-
#define build_mmio_read(name, size, type, reg, barrier) \
static inline type name(const volatile void __iomem *addr) \
{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \
@@ -334,6 +332,7 @@ extern void fixup_early_ioremap(void);
extern bool is_early_ioremap_ptep(pte_t *ptep);

#ifdef CONFIG_XEN
+#include <xen/xen.h>
struct bio_vec;

extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,