context_tracking: Rename context_tracking_active() to context_tracking_cpu_is_enabled()
authorFrederic Weisbecker <fweisbec@gmail.com>
Wed, 6 Nov 2013 14:11:57 +0000 (15:11 +0100)
committerFrederic Weisbecker <fweisbec@gmail.com>
Mon, 2 Dec 2013 19:43:15 +0000 (20:43 +0100)
We currently have a confusing couple of API naming with the existing
context_tracking_active() and context_tracking_is_enabled().

Lets keep the latter one, context_tracking_is_enabled(), for global
context tracking state check and use context_tracking_cpu_is_enabled()
for local state check.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
include/linux/context_tracking_state.h
include/linux/vtime.h

index 0db535b79be737169e2c7d94bfdc4f38d8decdc0..97a81225d037396fb8faae2fa0b3189ee045f7cb 100644 (file)
@@ -26,14 +26,15 @@ static inline bool context_tracking_is_enabled(void)
 {
        return static_key_false(&context_tracking_enabled);
 }
-static inline bool context_tracking_in_user(void)
+
+static inline bool context_tracking_cpu_is_enabled(void)
 {
-       return __this_cpu_read(context_tracking.state) == IN_USER;
+       return __this_cpu_read(context_tracking.active);
 }
 
-static inline bool context_tracking_active(void)
+static inline bool context_tracking_in_user(void)
 {
-       return __this_cpu_read(context_tracking.active);
+       return __this_cpu_read(context_tracking.state) == IN_USER;
 }
 #else
 static inline bool context_tracking_in_user(void) { return false; }
index 807c732cbf29e396260e1802762e397fc7936000..c5165fd256f9d25162d648e53e1e73d95a740caf 100644 (file)
@@ -20,7 +20,7 @@ static inline bool vtime_accounting_enabled(void) { return true; }
 static inline bool vtime_accounting_enabled(void)
 {
        if (context_tracking_is_enabled()) {
-               if (context_tracking_active())
+               if (context_tracking_cpu_is_enabled())
                        return true;
        }