Skip to content

Commit

Permalink
tools/lib/lockdep: Define the ARRAY_SIZE() macro
Browse files Browse the repository at this point in the history
lockdep.c now uses ARRAY_SIZE().

Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Fixes: 75dd602 ("lockdep: Fix lock_chain::base size")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
bwhacks authored and Ingo Molnar committed Jun 5, 2017
1 parent 98dcea0 commit 108744c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/lib/lockdep/uinclude/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <linux/hardirq.h>
#include <linux/kern_levels.h>

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

#ifndef container_of
#define container_of(ptr, type, member) ({ \
const typeof(((type *)0)->member) * __mptr = (ptr); \
Expand Down

0 comments on commit 108744c

Please sign in to comment.