lkml.org 
[lkml]   [2020]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] rcu-tasks: Fix compilation warning with !CONFIG_TASKS_RCU and CONFIG_TINY_RCU
On Sun, Aug 23, 2020 at 06:04:05AM +0300, Laurent Pinchart wrote:
> Commit 8344496e8b49 ("rcu-tasks: Conditionally compile
> show_rcu_tasks_gp_kthreads()") introduced conditional compilation of
> several functions, but forgot one occurrence of
> show_rcu_tasks_classic_gp_kthread() that causes the compiler to warn of
> an unused static function. Fix it.
>
> Fixes: 8344496e8b49 ("rcu-tasks: Conditionally compile show_rcu_tasks_gp_kthreads()")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> kernel/rcu/tasks.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
> index 835e2df8590a..bddf3968c1eb 100644
> --- a/kernel/rcu/tasks.h
> +++ b/kernel/rcu/tasks.h
> @@ -590,7 +590,9 @@ void exit_tasks_rcu_finish(void) __releases(&tasks_rcu_exit_srcu)
> }
>
> #else /* #ifdef CONFIG_TASKS_RCU */
> +#ifndef CONFIG_TINY_RCU
> static void show_rcu_tasks_classic_gp_kthread(void) { }
> +#endif /* #ifndef CONFIG_TINY_RCU */
> void exit_tasks_rcu_start(void) { }
> void exit_tasks_rcu_finish(void) { exit_tasks_rcu_finish_trace(current); }
> #endif /* #else #ifdef CONFIG_TASKS_RCU */

Good catch!!!

But does the following addition of "static inline" work for you?

Thanx, Paul

------------------------------------------------------------------------

diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 835e2df..3dc3ffc 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -590,9 +590,9 @@ void exit_tasks_rcu_finish(void) __releases(&tasks_rcu_exit_srcu)
}

#else /* #ifdef CONFIG_TASKS_RCU */
-static void show_rcu_tasks_classic_gp_kthread(void) { }
-void exit_tasks_rcu_start(void) { }
-void exit_tasks_rcu_finish(void) { exit_tasks_rcu_finish_trace(current); }
+static inline void show_rcu_tasks_classic_gp_kthread(void) { }
+static inline void exit_tasks_rcu_start(void) { }
+static inline void exit_tasks_rcu_finish(void) { exit_tasks_rcu_finish_trace(current); }
#endif /* #else #ifdef CONFIG_TASKS_RCU */

#ifdef CONFIG_TASKS_RUDE_RCU
\
 
 \ /
  Last update: 2020-08-25 17:03    [W:0.106 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site