Skip to content

Commit 30a35f7

Browse files
arndbIngo Molnar
authored andcommitted
locking/lockdep: Clean up #ifdef checks
As Will Deacon points out, CONFIG_PROVE_LOCKING implies TRACE_IRQFLAGS, so the conditions I added in the previous patch, and some others in the same file can be simplified by only checking for the former. No functional change. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Will Deacon <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Bart Van Assche <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Waiman Long <[email protected]> Cc: Yuyang Du <[email protected]> Fixes: 886532a ("locking/lockdep: Move mark_lock() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING") Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 68037aa commit 30a35f7

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

kernel/locking/lockdep.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static void print_lockdep_off(const char *bug_msg)
448448

449449
unsigned long nr_stack_trace_entries;
450450

451-
#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
451+
#ifdef CONFIG_PROVE_LOCKING
452452
/*
453453
* Stack-trace: tightly packed array of stack backtrace
454454
* addresses. Protected by the graph_lock.
@@ -491,7 +491,7 @@ unsigned int max_lockdep_depth;
491491
DEFINE_PER_CPU(struct lockdep_stats, lockdep_stats);
492492
#endif
493493

494-
#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
494+
#ifdef CONFIG_PROVE_LOCKING
495495
/*
496496
* Locking printouts:
497497
*/
@@ -2969,7 +2969,7 @@ static void check_chain_key(struct task_struct *curr)
29692969
#endif
29702970
}
29712971

2972-
#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
2972+
#ifdef CONFIG_PROVE_LOCKING
29732973
static int mark_lock(struct task_struct *curr, struct held_lock *this,
29742974
enum lock_usage_bit new_bit);
29752975

@@ -3608,7 +3608,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
36083608
return ret;
36093609
}
36103610

3611-
#else /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */
3611+
#else /* CONFIG_PROVE_LOCKING */
36123612

36133613
static inline int
36143614
mark_usage(struct task_struct *curr, struct held_lock *hlock, int check)
@@ -3627,7 +3627,7 @@ static inline int separate_irq_context(struct task_struct *curr,
36273627
return 0;
36283628
}
36293629

3630-
#endif /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */
3630+
#endif /* CONFIG_PROVE_LOCKING */
36313631

36323632
/*
36333633
* Initialize a lock instance's lock-class mapping info:
@@ -4321,8 +4321,7 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie
43214321
*/
43224322
static void check_flags(unsigned long flags)
43234323
{
4324-
#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) && \
4325-
defined(CONFIG_TRACE_IRQFLAGS)
4324+
#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP)
43264325
if (!debug_locks)
43274326
return;
43284327

0 commit comments

Comments
 (0)