Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 913769f2 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

lockdep: Simplify debug atomic ops



Simplify debug_atomic_inc/dec by using this_cpu_inc/dec() instead
of doing it through an indirect get_cpu_var() and a manual
incrementation.

Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
parent 8795d771
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -140,19 +140,13 @@ struct lockdep_stats {
DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats);

#define debug_atomic_inc(ptr)			{		\
	struct lockdep_stats *__cpu_lockdep_stats;		\
								\
	WARN_ON_ONCE(!irqs_disabled());				\
	__cpu_lockdep_stats = &__get_cpu_var(lockdep_stats);	\
	__cpu_lockdep_stats->ptr++;				\
	this_cpu_inc(lockdep_stats.ptr);			\
}

#define debug_atomic_dec(ptr)			{		\
	struct lockdep_stats *__cpu_lockdep_stats;		\
								\
	WARN_ON_ONCE(!irqs_disabled());				\
	__cpu_lockdep_stats = &__get_cpu_var(lockdep_stats);	\
	__cpu_lockdep_stats->ptr--;				\
	this_cpu_inc(lockdep_stats.ptr);			\
}

#define debug_atomic_read(ptr)		({				\