Fix the return value of exception_enter() to return CONTEXT_KERNEL rather
than 0 when the facility is disabled as the function returns an ctx_state
enum rather than a plain integer.

Signed-off-by: David Howells <dhowe...@redhat.com>
---

 include/linux/context_tracking.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index d05609ad329d..b4e9f9d80745 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -50,7 +50,7 @@ static inline enum ctx_state exception_enter(void)
        enum ctx_state prev_ctx;
 
        if (!context_tracking_is_enabled())
-               return 0;
+               return CONTEXT_KERNEL;
 
        prev_ctx = this_cpu_read(context_tracking.state);
        if (prev_ctx != CONTEXT_KERNEL)
@@ -85,7 +85,7 @@ static inline void user_enter(void) { }
 static inline void user_exit(void) { }
 static inline void user_enter_irqoff(void) { }
 static inline void user_exit_irqoff(void) { }
-static inline enum ctx_state exception_enter(void) { return 0; }
+static inline enum ctx_state exception_enter(void) { return CONTEXT_KERNEL; }
 static inline void exception_exit(enum ctx_state prev_ctx) { }
 static inline enum ctx_state ct_state(void) { return CONTEXT_DISABLED; }
 #endif /* !CONFIG_CONTEXT_TRACKING */

Reply via email to