lockdep: use stringify.h

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, March 30, 2009 - 6:00 pm

Gitweb:     http://git.kernel.org/linus/b4b136f44b3b7adb9265fd5566d0ea9b99b1cd5f
Commit:     b4b136f44b3b7adb9265fd5566d0ea9b99b1cd5f
Parent:     4f367d8adca947bed4385740a13d1efb1a06fba1
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Thu Jan 29 14:50:36 2009 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat Feb 14 23:28:26 2009 +0100

    lockdep: use stringify.h
    
    Arnd pointed out we have the stringify macro magic already in-kernel.
    
    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    CC: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/lockdep.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 42dfc28..fc84a30 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -41,6 +41,7 @@
 #include <linux/utsname.h>
 #include <linux/hash.h>
 #include <linux/ftrace.h>
+#include <linux/stringify.h>
 
 #include <asm/sections.h>
 
@@ -445,14 +446,11 @@ atomic_t nr_find_usage_backwards_recursions;
  * Locking printouts:
  */
 
-#define __STR(foo)	#foo
-#define STR(foo)	__STR(foo)
-
 #define __USAGE(__STATE)						\
-	[LOCK_USED_IN_##__STATE] = "IN-"STR(__STATE)"-W",		\
-	[LOCK_ENABLED_##__STATE] = STR(__STATE)"-ON-W",			\
-	[LOCK_USED_IN_##__STATE##_READ] = "IN-"STR(__STATE)"-R",	\
-	[LOCK_ENABLED_##__STATE##_READ] = STR(__STATE)"-ON-R",
+	[LOCK_USED_IN_##__STATE] = "IN-"__stringify(__STATE)"-W",	\
+	[LOCK_ENABLED_##__STATE] = __stringify(__STATE)"-ON-W",		\
+	[LOCK_USED_IN_##__STATE##_READ] = "IN-"__stringify(__STATE)"-R",\
+	[LOCK_ENABLED_##__STATE##_READ] = __stringify(__STATE)"-ON-R",
 
 static const char *usage_str[] =
 {
@@ -1270,14 +1268,14 @@ check_usage(struct task_struct *curr, struct held_lock *prev,
 
 static const char *state_names[] = {
 #define LOCKDEP_STATE(__STATE) \
-	STR(__STATE),
+	__stringify(__STATE),
 #include "lockdep_states.h"
 #undef LOCKDEP_STATE
 };
 
 static const char *state_rnames[] = {
 #define LOCKDEP_STATE(__STATE) \
-	STR(__STATE)"-READ",
+	__stringify(__STATE)"-READ",
 #include "lockdep_states.h"
 #undef LOCKDEP_STATE
 };
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
lockdep: use stringify.h, Linux Kernel Mailing ..., (Mon Mar 30, 6:00 pm)