Skip to content

Commit

Permalink
locking/lockdep: Provide empty lockdep_map structure for !CONFIG_LOCKDEP
Browse files Browse the repository at this point in the history
After this patch the lockdep_map structure takes no space if lockdep is
disabled, reducing the number of #ifdefs in unrelated kernel code.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: amir73il@gmail.com
Cc: axboe@kernel.dk
Cc: darrick.wong@oracle.com
Cc: david@fromorbit.com
Cc: hch@infradead.org
Cc: idryomov@gmail.com
Cc: johan@kernel.org
Cc: johannes.berg@intel.com
Cc: kernel-team@lge.com
Cc: linux-block@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-xfs@vger.kernel.org
Cc: oleg@redhat.com
Cc: tj@kernel.org
Link: http://lkml.kernel.org/r/1508921765-15396-3-git-send-email-byungchul.park@lge.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Byungchul Park authored and Ingo Molnar committed Oct 25, 2017
1 parent 65e53aa commit 6f0397d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ static inline void lockdep_on(void)
*/
struct lock_class_key { };

/*
* The lockdep_map takes no space if lockdep is disabled:
*/
struct lockdep_map { };

#define lockdep_depth(tsk) (0)

#define lockdep_is_held_type(l, r) (1)
Expand Down

0 comments on commit 6f0397d

Please sign in to comment.