linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vishal Thanki <vishalthanki@gmail.com>
To: sasha.levin@oracle.com, linux-kernel@vger.kernel.org
Cc: Vishal Thanki <vishalthanki@gmail.com>
Subject: [PATCH 1/2] liblockdep: Fix compile errors
Date: Thu,  9 Jun 2016 15:34:34 +0200	[thread overview]
Message-ID: <1465479275-32468-2-git-send-email-vishalthanki@gmail.com> (raw)
In-Reply-To: <1465479275-32468-1-git-send-email-vishalthanki@gmail.com>

Following commit caused failures.

dfaaf3fa0: (Use __jhash_mix() for iterate_chain_key())
Fixed by adding jhash.h with minimal stuff required

75dd602a5: (lockdep: Fix lock_chain::base size)
Fixed by adding ARRAY_SIZE macro definition and
changing the MAX_LOCK_DEPTH value to similar defined
in linux/sched.h

Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
---
 tools/lib/lockdep/lockdep.c                |  2 +-
 tools/lib/lockdep/uinclude/linux/jhash.h   | 20 ++++++++++++++++++++
 tools/lib/lockdep/uinclude/linux/kernel.h  |  1 +
 tools/lib/lockdep/uinclude/linux/lockdep.h |  2 +-
 4 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 tools/lib/lockdep/uinclude/linux/jhash.h

diff --git a/tools/lib/lockdep/lockdep.c b/tools/lib/lockdep/lockdep.c
index a0a2e3a..1ba6f33 100644
--- a/tools/lib/lockdep/lockdep.c
+++ b/tools/lib/lockdep/lockdep.c
@@ -4,5 +4,5 @@
 #define hlist_for_each_entry_rcu	hlist_for_each_entry
 #define hlist_add_head_rcu		hlist_add_head
 #define hlist_del_rcu			hlist_del
-
+#define prandom_u32			rand
 #include "../../../kernel/locking/lockdep.c"
diff --git a/tools/lib/lockdep/uinclude/linux/jhash.h b/tools/lib/lockdep/uinclude/linux/jhash.h
new file mode 100644
index 0000000..5c40bd1
--- /dev/null
+++ b/tools/lib/lockdep/uinclude/linux/jhash.h
@@ -0,0 +1,20 @@
+#ifndef _LINUX_JHASH_H
+#define _LINUX_JHASH_H
+
+static inline __u32 rol32(__u32 word, unsigned int shift)
+{
+	return (word << shift) | (word >> ((-shift) & 31));
+}
+
+/* __jhash_mix -- mix 3 32-bit values reversibly. */
+#define __jhash_mix(a, b, c)			\
+{						\
+	a -= c;  a ^= rol32(c, 4);  c += b;	\
+	b -= a;  b ^= rol32(a, 6);  a += c;	\
+	c -= b;  c ^= rol32(b, 8);  b += a;	\
+	a -= c;  a ^= rol32(c, 16); c += b;	\
+	b -= a;  b ^= rol32(a, 19); a += c;	\
+	c -= b;  c ^= rol32(b, 4);  b += a;	\
+}
+
+#endif /* _LINUX_JHASH_H */
diff --git a/tools/lib/lockdep/uinclude/linux/kernel.h b/tools/lib/lockdep/uinclude/linux/kernel.h
index 276c7a8..ab204c8 100644
--- a/tools/lib/lockdep/uinclude/linux/kernel.h
+++ b/tools/lib/lockdep/uinclude/linux/kernel.h
@@ -44,4 +44,5 @@
 #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
 #endif
 
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
 #endif
diff --git a/tools/lib/lockdep/uinclude/linux/lockdep.h b/tools/lib/lockdep/uinclude/linux/lockdep.h
index c808c7d..8f6e725 100644
--- a/tools/lib/lockdep/uinclude/linux/lockdep.h
+++ b/tools/lib/lockdep/uinclude/linux/lockdep.h
@@ -8,7 +8,7 @@
 #include <linux/utsname.h>
 #include <linux/compiler.h>
 
-#define MAX_LOCK_DEPTH 2000UL
+#define MAX_LOCK_DEPTH 48UL
 
 #define asmlinkage
 #define __visible
-- 
2.4.11

  reply	other threads:[~2016-06-09 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 13:34 [PATCH 0/2] Fixing the compilation errors for liblockdep Vishal Thanki
2016-06-09 13:34 ` Vishal Thanki [this message]
2016-06-11  3:53   ` [PATCH 1/2] liblockdep: Fix compile errors Sasha Levin
2016-06-11  8:36     ` Vishal Thanki
2016-06-13 20:38       ` Sasha Levin
2016-06-14 10:26         ` Vishal Thanki
2016-06-09 13:34 ` [PATCH 2/2] liblockdep: Remove -lpthread compiler option Vishal Thanki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465479275-32468-2-git-send-email-vishalthanki@gmail.com \
    --to=vishalthanki@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).