Message ID | 87621dygvw.fsf@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
2013/2/27 Kevin Hilman <khilman@linaro.org>: > From 61e35f069a64c03a2bce348487d41072aeb9f36b Mon Sep 17 00:00:00 2001 > From: Kevin Hilman <khilman@linaro.org> > Date: Thu, 14 Feb 2013 10:17:37 -0800 > Subject: [PATCH] context tracking: conditionalize guest support based on > CONFIG_KVM > > So that it can build on !KVM systems too. > > Signed-off-by: Kevin Hilman <khilman@linaro.org> > --- > kernel/context_tracking.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c > index 74f68f4..fda6cd6 100644 > --- a/kernel/context_tracking.c > +++ b/kernel/context_tracking.c > @@ -1,5 +1,7 @@ > #include <linux/context_tracking.h> > +#if IS_ENABLED(CONFIG_KVM) > #include <linux/kvm_host.h> > +#endif Please fix the header rather than its inclusion. General purpose headers like this must be able to handle the off-cases. Thanks.
diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 74f68f4..fda6cd6 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -1,5 +1,7 @@ #include <linux/context_tracking.h> +#if IS_ENABLED(CONFIG_KVM) #include <linux/kvm_host.h> +#endif #include <linux/rcupdate.h> #include <linux/sched.h> #include <linux/hardirq.h> @@ -62,6 +64,7 @@ void user_exit(void) local_irq_restore(flags); } +#if IS_ENABLED(CONFIG_KVM) void guest_enter(void) { if (vtime_accounting_enabled()) @@ -79,6 +82,7 @@ void guest_exit(void) __guest_exit(); } EXPORT_SYMBOL_GPL(guest_exit); +#endif void context_tracking_task_switch(struct task_struct *prev, struct task_struct *next)