Skip to content

Commit

Permalink
rcu: Remove redundant CONFIG_PROVE_RCU #if condition
Browse files Browse the repository at this point in the history
The #if condition controlling the rcu_preempt_sleep_check() definition
has a redundant check for CONFIG_PREEMPT_RCU, which is already checked
for by an enclosing #ifndef.  This commit therefore removes this redundant
condition from the inner #if.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
  • Loading branch information
Paul E. McKenney authored and Uladzislau Rezki (Sony) committed Apr 15, 2024
1 parent fc2897d commit 10c9e40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/rcupdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ static inline int debug_lockdep_rcu_enabled(void)
} \
} while (0)

#if defined(CONFIG_PROVE_RCU) && !defined(CONFIG_PREEMPT_RCU)
#ifndef CONFIG_PREEMPT_RCU
static inline void rcu_preempt_sleep_check(void)
{
RCU_LOCKDEP_WARN(lock_is_held(&rcu_lock_map),
"Illegal context switch in RCU read-side critical section");
}
#else /* #ifdef CONFIG_PROVE_RCU */
#else // #ifndef CONFIG_PREEMPT_RCU
static inline void rcu_preempt_sleep_check(void) { }
#endif /* #else #ifdef CONFIG_PROVE_RCU */
#endif // #else // #ifndef CONFIG_PREEMPT_RCU

#define rcu_sleep_check() \
do { \
Expand Down

0 comments on commit 10c9e40

Please sign in to comment.