Skip to content

Commit

Permalink
rcu: Fix harmless omission of "CONFIG_" from #if condition
Browse files Browse the repository at this point in the history
The C preprocessor macros SRCU and TINY_RCU should instead be CONFIG_SRCU
and CONFIG_TINY_RCU, respectively in the #f in kernel/rcu/rcu.h. 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 included, and the included code block doesn't
cause any compilation error so far in CONFIG_TINY_RCU builds.  It is
also the reason this change should not be taken in -stable.

This commit adds the needed "CONFIG_" prefix to both macros.

Not for -stable.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
  • Loading branch information
Lai Jiangshan authored and Paul E. McKenney committed Jan 24, 2020
1 parent c30fe54 commit 822175e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/rcu/rcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,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 <linux/rcu_node_tree.h>

Expand Down Expand Up @@ -418,7 +418,7 @@ do { \
#define raw_lockdep_assert_held_rcu_node(p) \
lockdep_assert_held(&ACCESS_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);
Expand Down

0 comments on commit 822175e

Please sign in to comment.