From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932316AbcFINen (ORCPT ); Thu, 9 Jun 2016 09:34:43 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34088 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbcFINel (ORCPT ); Thu, 9 Jun 2016 09:34:41 -0400 From: Vishal Thanki To: sasha.levin@oracle.com, linux-kernel@vger.kernel.org Cc: Vishal Thanki Subject: [PATCH 1/2] liblockdep: Fix compile errors Date: Thu, 9 Jun 2016 15:34:34 +0200 Message-Id: <1465479275-32468-2-git-send-email-vishalthanki@gmail.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1465479275-32468-1-git-send-email-vishalthanki@gmail.com> References: <1465479275-32468-1-git-send-email-vishalthanki@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include -#define MAX_LOCK_DEPTH 2000UL +#define MAX_LOCK_DEPTH 48UL #define asmlinkage #define __visible -- 2.4.11