diff options
Diffstat (limited to 'include/linux/context_tracking_state.h')
-rw-r--r-- | include/linux/context_tracking_state.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h index 0f1979d0674f..97a81225d037 100644 --- a/include/linux/context_tracking_state.h +++ b/include/linux/context_tracking_state.h | |||
@@ -22,15 +22,20 @@ struct context_tracking { | |||
22 | extern struct static_key context_tracking_enabled; | 22 | extern struct static_key context_tracking_enabled; |
23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); | 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); |
24 | 24 | ||
25 | static inline bool context_tracking_in_user(void) | 25 | static inline bool context_tracking_is_enabled(void) |
26 | { | 26 | { |
27 | return __this_cpu_read(context_tracking.state) == IN_USER; | 27 | return static_key_false(&context_tracking_enabled); |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline bool context_tracking_active(void) | 30 | static inline bool context_tracking_cpu_is_enabled(void) |
31 | { | 31 | { |
32 | return __this_cpu_read(context_tracking.active); | 32 | return __this_cpu_read(context_tracking.active); |
33 | } | 33 | } |
34 | |||
35 | static inline bool context_tracking_in_user(void) | ||
36 | { | ||
37 | return __this_cpu_read(context_tracking.state) == IN_USER; | ||
38 | } | ||
34 | #else | 39 | #else |
35 | static inline bool context_tracking_in_user(void) { return false; } | 40 | static inline bool context_tracking_in_user(void) { return false; } |
36 | static inline bool context_tracking_active(void) { return false; } | 41 | static inline bool context_tracking_active(void) { return false; } |