| From 27dd2eeaf3d8fef1bb937dbbf6cf106262e22cc5 Mon Sep 17 00:00:00 2001 |
| From: Arnd Bergmann <arnd@arndb.de> |
| Date: Fri, 28 Jun 2019 12:29:03 +0200 |
| Subject: [PATCH] locking/lockdep: Clean up #ifdef checks |
| |
| commit 30a35f79faadfeb1b89a7fdb3875f14063519041 upstream. |
| |
| 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 <arnd@arndb.de> |
| Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> |
| Acked-by: Will Deacon <will@kernel.org> |
| Cc: Andrew Morton <akpm@linux-foundation.org> |
| Cc: Bart Van Assche <bvanassche@acm.org> |
| Cc: Frederic Weisbecker <frederic@kernel.org> |
| Cc: Linus Torvalds <torvalds@linux-foundation.org> |
| Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
| Cc: Peter Zijlstra <peterz@infradead.org> |
| Cc: Thomas Gleixner <tglx@linutronix.de> |
| Cc: Waiman Long <longman@redhat.com> |
| Cc: Yuyang Du <duyuyang@gmail.com> |
| Fixes: 886532aee3cd ("locking/lockdep: Move mark_lock() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING") |
| Link: https://lkml.kernel.org/r/20190628102919.2345242-1-arnd@arndb.de |
| Signed-off-by: Ingo Molnar <mingo@kernel.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c |
| index fba991399c0a..0b956fde19de 100644 |
| --- a/kernel/locking/lockdep.c |
| +++ b/kernel/locking/lockdep.c |
| @@ -430,7 +430,7 @@ static void print_lockdep_off(const char *bug_msg) |
| |
| unsigned long nr_stack_trace_entries; |
| |
| -#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) |
| +#ifdef CONFIG_PROVE_LOCKING |
| /* |
| * Stack-trace: tightly packed array of stack backtrace |
| * addresses. Protected by the graph_lock. |
| @@ -473,7 +473,7 @@ unsigned int max_lockdep_depth; |
| DEFINE_PER_CPU(struct lockdep_stats, lockdep_stats); |
| #endif |
| |
| -#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) |
| +#ifdef CONFIG_PROVE_LOCKING |
| /* |
| * Locking printouts: |
| */ |
| @@ -2879,7 +2879,7 @@ static void check_chain_key(struct task_struct *curr) |
| #endif |
| } |
| |
| -#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) |
| +#ifdef CONFIG_PROVE_LOCKING |
| static int mark_lock(struct task_struct *curr, struct held_lock *this, |
| enum lock_usage_bit new_bit); |
| |
| @@ -3522,7 +3522,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this, |
| return ret; |
| } |
| |
| -#else /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */ |
| +#else /* CONFIG_PROVE_LOCKING */ |
| |
| static inline int |
| mark_usage(struct task_struct *curr, struct held_lock *hlock, int check) |
| @@ -3541,7 +3541,7 @@ static inline int separate_irq_context(struct task_struct *curr, |
| return 0; |
| } |
| |
| -#endif /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */ |
| +#endif /* CONFIG_PROVE_LOCKING */ |
| |
| /* |
| * Initialize a lock instance's lock-class mapping info: |
| @@ -4229,8 +4229,7 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie |
| */ |
| static void check_flags(unsigned long flags) |
| { |
| -#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) && \ |
| - defined(CONFIG_TRACE_IRQFLAGS) |
| +#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) |
| if (!debug_locks) |
| return; |
| |
| -- |
| 2.7.4 |
| |