preempt: Reorganize the notrace definitions a bit
authorFrederic Weisbecker <fweisbec@gmail.com>
Thu, 4 Jun 2015 15:39:09 +0000 (17:39 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 7 Jun 2015 13:57:43 +0000 (15:57 +0200)
preempt.h has two seperate "#ifdef CONFIG_PREEMPT" sections: one to
define preempt_enable() and another to define preempt_enable_notrace().

Lets gather both.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1433432349-1021-4-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/preempt.h

index 7686dd63bc35b57fdcce8701bb49bd441e0b2384..0f1534acaf60983da1cc84548659ccc1398d79e9 100644 (file)
@@ -175,48 +175,46 @@ do { \
                __preempt_schedule(); \
 } while (0)
 
+#define preempt_enable_notrace() \
+do { \
+       barrier(); \
+       if (unlikely(__preempt_count_dec_and_test())) \
+               __preempt_schedule_notrace(); \
+} while (0)
+
 #define preempt_check_resched() \
 do { \
        if (should_resched()) \
                __preempt_schedule(); \
 } while (0)
 
-#else
+#else /* !CONFIG_PREEMPT */
 #define preempt_enable() \
 do { \
        barrier(); \
        preempt_count_dec(); \
 } while (0)
-#define preempt_check_resched() do { } while (0)
-#endif
-
-#define preempt_disable_notrace() \
-do { \
-       __preempt_count_inc(); \
-       barrier(); \
-} while (0)
 
-#define preempt_enable_no_resched_notrace() \
+#define preempt_enable_notrace() \
 do { \
        barrier(); \
        __preempt_count_dec(); \
 } while (0)
 
-#ifdef CONFIG_PREEMPT
+#define preempt_check_resched() do { } while (0)
+#endif /* CONFIG_PREEMPT */
 
-#define preempt_enable_notrace() \
+#define preempt_disable_notrace() \
 do { \
+       __preempt_count_inc(); \
        barrier(); \
-       if (unlikely(__preempt_count_dec_and_test())) \
-               __preempt_schedule_notrace(); \
 } while (0)
-#else
-#define preempt_enable_notrace() \
+
+#define preempt_enable_no_resched_notrace() \
 do { \
        barrier(); \
        __preempt_count_dec(); \
 } while (0)
-#endif
 
 #else /* !CONFIG_PREEMPT_COUNT */