[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-62347c63f0646e76a36dc7039d395e0faa880c79@git.kernel.org>
Date: Mon, 11 Feb 2013 04:21:18 -0800
From: tip-bot for Sasha Levin <sasha.levin@...cle.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, sasha.levin@...cle.com,
hpa@...or.com, mingo@...nel.org, a.p.zijlstra@...llo.nl,
torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
tglx@...utronix.de
Subject: [tip:core/locking] liblockdep:
Remove the need for liblockdep_init()
Commit-ID: 62347c63f0646e76a36dc7039d395e0faa880c79
Gitweb: http://git.kernel.org/tip/62347c63f0646e76a36dc7039d395e0faa880c79
Author: Sasha Levin <sasha.levin@...cle.com>
AuthorDate: Sat, 9 Feb 2013 19:39:31 -0500
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 11 Feb 2013 10:12:36 +0100
liblockdep: Remove the need for liblockdep_init()
Use a constructor in the library instead of making the user
manually call liblockdep_init().
Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
Cc: jamie.iles@...cle.com
Cc: penberg@...nel.org
Cc: acme@...stprotocols.net
Cc: paulus@...ba.org
Cc: namhyung@...nel.org
Cc: peterz@...radead.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/1360456781-32462-1-git-send-email-sasha.levin@oracle.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
tools/lib/lockdep/common.c | 2 +-
tools/lib/lockdep/include/liblockdep/common.h | 1 -
tools/lib/lockdep/tests/AA.c | 1 -
tools/lib/lockdep/tests/ABBA.c | 1 -
tools/lib/lockdep/tests/ABBCCA.c | 1 -
tools/lib/lockdep/tests/ABBCCDDA.c | 1 -
tools/lib/lockdep/tests/ABCABC.c | 1 -
tools/lib/lockdep/tests/ABCDBCDA.c | 1 -
tools/lib/lockdep/tests/ABCDBDDA.c | 1 -
tools/lib/lockdep/tests/WW.c | 1 -
tools/lib/lockdep/tests/unlock_balance.c | 1 -
tools/lib/lockdep/uinclude/linux/lockdep.h | 1 -
12 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/tools/lib/lockdep/common.c b/tools/lib/lockdep/common.c
index 99d3b4b..d2946e0 100644
--- a/tools/lib/lockdep/common.c
+++ b/tools/lib/lockdep/common.c
@@ -10,7 +10,7 @@ __thread struct task_struct current_obj;
bool debug_locks = true;
bool debug_locks_silent;
-void liblockdep_init(void)
+__attribute__((constructor)) static void liblockdep_init(void)
{
lockdep_init();
}
diff --git a/tools/lib/lockdep/include/liblockdep/common.h b/tools/lib/lockdep/include/liblockdep/common.h
index b72f9c1..f6f7fec8 100644
--- a/tools/lib/lockdep/include/liblockdep/common.h
+++ b/tools/lib/lockdep/include/liblockdep/common.h
@@ -26,7 +26,6 @@ struct lockdep_map {
#endif
};
-void liblockdep_init(void);
void liblockdep_set_thread(void);
void lockdep_init_map(struct lockdep_map *lock, const char *name,
struct lock_class_key *key, int subclass);
diff --git a/tools/lib/lockdep/tests/AA.c b/tools/lib/lockdep/tests/AA.c
index 933d32f..3f71333 100644
--- a/tools/lib/lockdep/tests/AA.c
+++ b/tools/lib/lockdep/tests/AA.c
@@ -4,7 +4,6 @@ void main(void)
{
pthread_mutex_t a, b;
- liblockdep_init();
liblockdep_set_thread();
pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/ABBA.c b/tools/lib/lockdep/tests/ABBA.c
index 9f5146b..08d87a7 100644
--- a/tools/lib/lockdep/tests/ABBA.c
+++ b/tools/lib/lockdep/tests/ABBA.c
@@ -5,7 +5,6 @@ void main(void)
{
pthread_mutex_t a, b;
- liblockdep_init();
liblockdep_set_thread();
pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/ABBCCA.c b/tools/lib/lockdep/tests/ABBCCA.c
index b7435d7..c5d0e5c 100644
--- a/tools/lib/lockdep/tests/ABBCCA.c
+++ b/tools/lib/lockdep/tests/ABBCCA.c
@@ -5,7 +5,6 @@ void main(void)
{
pthread_mutex_t a, b, c;
- liblockdep_init();
liblockdep_set_thread();
pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/ABBCCDDA.c b/tools/lib/lockdep/tests/ABBCCDDA.c
index 2425330..e12dc98 100644
--- a/tools/lib/lockdep/tests/ABBCCDDA.c
+++ b/tools/lib/lockdep/tests/ABBCCDDA.c
@@ -5,7 +5,6 @@ void main(void)
{
pthread_mutex_t a, b, c, d;
- liblockdep_init();
liblockdep_set_thread();
pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/ABCABC.c b/tools/lib/lockdep/tests/ABCABC.c
index 2ee30fe..70879c95 100644
--- a/tools/lib/lockdep/tests/ABCABC.c
+++ b/tools/lib/lockdep/tests/ABCABC.c
@@ -5,7 +5,6 @@ void main(void)
{
pthread_mutex_t a, b, c;
- liblockdep_init();
liblockdep_set_thread();
pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/ABCDBCDA.c b/tools/lib/lockdep/tests/ABCDBCDA.c
index 32d19d6..00cd676 100644
--- a/tools/lib/lockdep/tests/ABCDBCDA.c
+++ b/tools/lib/lockdep/tests/ABCDBCDA.c
@@ -5,7 +5,6 @@ void main(void)
{
liblockdep_pthread_mutex_t a, b, c, d;
- liblockdep_init();
liblockdep_set_thread();
liblockdep_pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/ABCDBDDA.c b/tools/lib/lockdep/tests/ABCDBDDA.c
index 850eaca..19b3ed1 100644
--- a/tools/lib/lockdep/tests/ABCDBDDA.c
+++ b/tools/lib/lockdep/tests/ABCDBDDA.c
@@ -5,7 +5,6 @@ void main(void)
{
pthread_mutex_t a, b, c, d;
- liblockdep_init();
liblockdep_set_thread();
pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/WW.c b/tools/lib/lockdep/tests/WW.c
index 4b1be0f..2467b13 100644
--- a/tools/lib/lockdep/tests/WW.c
+++ b/tools/lib/lockdep/tests/WW.c
@@ -4,7 +4,6 @@ void main(void)
{
pthread_rwlock_t a, b;
- liblockdep_init();
liblockdep_set_thread();
pthread_rwlock_init(&a, NULL);
diff --git a/tools/lib/lockdep/tests/unlock_balance.c b/tools/lib/lockdep/tests/unlock_balance.c
index 9dfaf97..07a4c21 100644
--- a/tools/lib/lockdep/tests/unlock_balance.c
+++ b/tools/lib/lockdep/tests/unlock_balance.c
@@ -4,7 +4,6 @@ void main(void)
{
pthread_mutex_t a;
- liblockdep_init();
liblockdep_set_thread();
pthread_mutex_init(&a, NULL);
diff --git a/tools/lib/lockdep/uinclude/linux/lockdep.h b/tools/lib/lockdep/uinclude/linux/lockdep.h
index 1ed83a5..611cb28 100644
--- a/tools/lib/lockdep/uinclude/linux/lockdep.h
+++ b/tools/lib/lockdep/uinclude/linux/lockdep.h
@@ -25,7 +25,6 @@ struct task_struct {
extern __thread struct task_struct current_obj;
#define current (¤t_obj)
-void liblockdep_init(void);
void liblockdep_set_thread(void);
#define debug_locks_off() 1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists