[PATCH RFC v2 tip/core/rcu 17/22] rcu-tasks: Move #ifdef into tasks.h

From: paulmck
Date: Wed Mar 18 2020 - 20:11:42 EST


From: "Paul E. McKenney" <paulmck@xxxxxxxxxx>

This commit pushes the #ifdef CONFIG_TASKS_RCU_GENERIC from
kernel/rcu/update.c to kernel/rcu/tasks.h in order to improve
readability as more APIs are added.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
---
kernel/rcu/tasks.h | 5 +++++
kernel/rcu/update.c | 4 ----
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index e6ef98e..220f264 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -5,6 +5,7 @@
* Copyright (C) 2020 Paul E. McKenney
*/

+#ifdef CONFIG_TASKS_RCU_GENERIC

////////////////////////////////////////////////////////////////////////
//
@@ -976,3 +977,7 @@ core_initcall(rcu_spawn_tasks_trace_kthread);
#else /* #ifdef CONFIG_TASKS_TRACE_RCU */
void exit_tasks_rcu_finish_trace(struct task_struct *t) { }
#endif /* #else #ifdef CONFIG_TASKS_TRACE_RCU */
+
+#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
+static inline void rcu_tasks_bootup_oddness(void) {}
+#endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 16058a5..0fb2a9e 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -559,11 +559,7 @@ late_initcall(rcu_verify_early_boot_tests);
void rcu_early_boot_tests(void) {}
#endif /* CONFIG_PROVE_RCU */

-#ifdef CONFIG_TASKS_RCU_GENERIC
#include "tasks.h"
-#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
-static inline void rcu_tasks_bootup_oddness(void) {}
-#endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */

#ifndef CONFIG_TINY_RCU

--
2.9.5