liblockdep: Define the ARRAY_SIZE() macro
authorBen Hutchings <ben@decadent.org.uk>
Tue, 14 Jun 2016 20:14:14 +0000 (21:14 +0100)
committerYves-Alexis Perez <corsac@debian.org>
Fri, 9 Feb 2018 12:58:52 +0000 (12:58 +0000)
lockdep.c now uses ARRAY_SIZE().

Fixes: 75dd602a5198 ("lockdep: Fix lock_chain::base size")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-define-the-array_size-macro.patch

tools/lib/lockdep/uinclude/linux/kernel.h

index 276c7a8b2ed127ccdad6d4be0f31580bde9a84ff..da87bd9ad2c1848100987ba415cfae90792eb4b3 100644 (file)
@@ -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);     \