lkml.org 
[lkml]   [2017]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 03/15] liblockdep: Define the ARRAY_SIZE() macro
Date
From: Ben Hutchings <ben@decadent.org.uk>

lockdep.c now uses ARRAY_SIZE().

Fixes: 75dd602a5198 ("lockdep: Fix lock_chain::base size")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
tools/lib/lockdep/uinclude/linux/kernel.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/lib/lockdep/uinclude/linux/kernel.h b/tools/lib/lockdep/uinclude/linux/kernel.h
index 276c7a8b2ed1..da87bd9ad2c1 100644
--- a/tools/lib/lockdep/uinclude/linux/kernel.h
+++ b/tools/lib/lockdep/uinclude/linux/kernel.h
@@ -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); \
--
2.11.0
\
 
 \ /
  Last update: 2017-05-18 02:04    [W:0.110 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site