aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-05-03 22:47:25 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-03 23:37:28 -0400
commitba697f40dbb704956a4cf67a7845b538015a01ea (patch)
tree9ab6f1391bd45c52145d04b588e31c2f1abe0c53 /kernel
parent0e417fe1f247bb3ac056ee04604332005c334fac (diff)
lockdep: Provide off case for redundant_hardirqs_on increment
We forgot to provide a !CONFIG_DEBUG_LOCKDEP case for the redundant_hardirqs_on stat handling. Manage that in the headers with a new __debug_atomic_inc() helper. Fixes: kernel/lockdep.c:2306: error: 'lockdep_stats' undeclared (first use in this function) kernel/lockdep.c:2306: error: (Each undeclared identifier is reported only once kernel/lockdep.c:2306: error: for each function it appears in.) Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/lockdep.c2
-rw-r--r--kernel/lockdep_internals.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 1b58a1bbcc87..9cf79858fd82 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2303,7 +2303,7 @@ void trace_hardirqs_on_caller(unsigned long ip)
2303 * so this is racy by nature but loosing one hit 2303 * so this is racy by nature but loosing one hit
2304 * in a stat is not a big deal. 2304 * in a stat is not a big deal.
2305 */ 2305 */
2306 this_cpu_inc(lockdep_stats.redundant_hardirqs_on); 2306 __debug_atomic_inc(redundant_hardirqs_on);
2307 return; 2307 return;
2308 } 2308 }
2309 /* we'll do an OFF -> ON transition: */ 2309 /* we'll do an OFF -> ON transition: */
diff --git a/kernel/lockdep_internals.h b/kernel/lockdep_internals.h
index 2b174762fa0e..7de27a80f802 100644
--- a/kernel/lockdep_internals.h
+++ b/kernel/lockdep_internals.h
@@ -139,6 +139,9 @@ struct lockdep_stats {
139 139
140DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats); 140DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats);
141 141
142#define __debug_atomic_inc(ptr) \
143 this_cpu_inc(lockdep_stats.ptr);
144
142#define debug_atomic_inc(ptr) { \ 145#define debug_atomic_inc(ptr) { \
143 WARN_ON_ONCE(!irqs_disabled()); \ 146 WARN_ON_ONCE(!irqs_disabled()); \
144 this_cpu_inc(lockdep_stats.ptr); \ 147 this_cpu_inc(lockdep_stats.ptr); \
@@ -160,6 +163,7 @@ DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats);
160 __total; \ 163 __total; \
161}) 164})
162#else 165#else
166# define __debug_atomic_inc(ptr) do { } while (0)
163# define debug_atomic_inc(ptr) do { } while (0) 167# define debug_atomic_inc(ptr) do { } while (0)
164# define debug_atomic_dec(ptr) do { } while (0) 168# define debug_atomic_dec(ptr) do { } while (0)
165# define debug_atomic_read(ptr) 0 169# define debug_atomic_read(ptr) 0