lkml.org 
[lkml]   [2013]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 07/11] liblockdep: prevent multiple declarations of CALLER_ADDR0
Date
They are declared once in the public and once in the private headers, prevent
declaring them twice if both headers are used.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
tools/lib/lockdep/include/liblockdep/common.h | 3 +++
tools/lib/lockdep/uinclude/linux/kernel.h | 2 ++
2 files changed, 5 insertions(+)

diff --git a/tools/lib/lockdep/include/liblockdep/common.h b/tools/lib/lockdep/include/liblockdep/common.h
index a675ef0..1bad66c 100644
--- a/tools/lib/lockdep/include/liblockdep/common.h
+++ b/tools/lib/lockdep/include/liblockdep/common.h
@@ -3,8 +3,11 @@

#include <pthread.h>

+#ifndef CALLER_ADDR0
#define CALLER_ADDR0 (__builtin_return_address(0))
#define _THIS_IP_ CALLER_ADDR0
+#endif
+
#define NR_LOCKDEP_CACHING_CLASSES 2
#define MAX_LOCKDEP_SUBCLASSES 8UL

diff --git a/tools/lib/lockdep/uinclude/linux/kernel.h b/tools/lib/lockdep/uinclude/linux/kernel.h
index da97ce8..af02ac1 100644
--- a/tools/lib/lockdep/uinclude/linux/kernel.h
+++ b/tools/lib/lockdep/uinclude/linux/kernel.h
@@ -28,7 +28,9 @@
#define noinline
#define list_add_tail_rcu list_add_tail

+#ifndef CALLER_ADDR0
#define _THIS_IP_ CALLER_ADDR0
#define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
+#endif

#endif
--
1.8.1.2


\
 
 \ /
  Last update: 2013-02-10 02:21    [W:0.166 / U:1.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site