Re: [PATCH 1/7] rcu: fix incorrect conditional compilation

2019-10-15 Thread Paul E. McKenney
On Tue, Oct 15, 2019 at 10:23:56AM +, Lai Jiangshan wrote:
> DO NOT pick it to stable tree.
> (Since the title has "fix", this statement may help stop
> AI pick it to stable tree)
> 
> The tokens SRCU and TINY_RCU are not defined by any configurations,
> they should be CONFIG_SRCU and CONFIG_TINY_RCU. But there is no
> harm when "TINY_RCU" is wrongly used, which are always non-defined,
> which makes "!defined(TINY_RCU)" always true, which means
> the code block is always inclued, and the included code block
> doesn't cause any compilation error so far when CONFIG_TINY_RCU.
> It is also the reason this change doesn't need for stable.
> 
> Signed-off-by: Lai Jiangshan 
> Signed-off-by: Lai Jiangshan 

Applied for review and testing, thank you!

Thanx, Paul

> ---
>  kernel/rcu/rcu.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
> index a7ab2a023dd3..05f936ed167a 100644
> --- a/kernel/rcu/rcu.h
> +++ b/kernel/rcu/rcu.h
> @@ -254,7 +254,7 @@ void rcu_test_sync_prims(void);
>   */
>  extern void resched_cpu(int cpu);
>  
> -#if defined(SRCU) || !defined(TINY_RCU)
> +#if defined(CONFIG_SRCU) || !defined(CONFIG_TINY_RCU)
>  
>  #include 
>  
> @@ -391,7 +391,7 @@ do {  
> \
>  #define raw_lockdep_assert_held_rcu_node(p)  \
>   lockdep_assert_held(_PRIVATE(p, lock))
>  
> -#endif /* #if defined(SRCU) || !defined(TINY_RCU) */
> +#endif /* #if defined(CONFIG_SRCU) || !defined(CONFIG_TINY_RCU) */
>  
>  #ifdef CONFIG_SRCU
>  void srcu_init(void);
> -- 
> 2.20.1
> 


[PATCH 1/7] rcu: fix incorrect conditional compilation

2019-10-15 Thread Lai Jiangshan
DO NOT pick it to stable tree.
(Since the title has "fix", this statement may help stop
AI pick it to stable tree)

The tokens SRCU and TINY_RCU are not defined by any configurations,
they should be CONFIG_SRCU and CONFIG_TINY_RCU. But there is no
harm when "TINY_RCU" is wrongly used, which are always non-defined,
which makes "!defined(TINY_RCU)" always true, which means
the code block is always inclued, and the included code block
doesn't cause any compilation error so far when CONFIG_TINY_RCU.
It is also the reason this change doesn't need for stable.

Signed-off-by: Lai Jiangshan 
Signed-off-by: Lai Jiangshan 
---
 kernel/rcu/rcu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index a7ab2a023dd3..05f936ed167a 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -254,7 +254,7 @@ void rcu_test_sync_prims(void);
  */
 extern void resched_cpu(int cpu);
 
-#if defined(SRCU) || !defined(TINY_RCU)
+#if defined(CONFIG_SRCU) || !defined(CONFIG_TINY_RCU)
 
 #include 
 
@@ -391,7 +391,7 @@ do {
\
 #define raw_lockdep_assert_held_rcu_node(p)\
lockdep_assert_held(_PRIVATE(p, lock))
 
-#endif /* #if defined(SRCU) || !defined(TINY_RCU) */
+#endif /* #if defined(CONFIG_SRCU) || !defined(CONFIG_TINY_RCU) */
 
 #ifdef CONFIG_SRCU
 void srcu_init(void);
-- 
2.20.1