[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1233237249.4495.82.camel@laptop>
Date: Thu, 29 Jan 2009 14:54:09 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: mingo@...e.hu
Cc: linux-kernel@...r.kernel.org, npiggin@...e.de,
Arnd Bergmann <arnd@...db.de>
Subject: [PATCH 22/21] lockdep: use stringify.h
Subject: lockdep: use stringify.h
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Date: Thu Jan 29 14:50:36 CET 2009
Arnd pointed out we have the stringify macro magic already in-kernel.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC: Arnd Bergmann <arnd@...db.de>
---
kernel/lockdep.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
Index: linux-2.6/kernel/lockdep.c
===================================================================
--- linux-2.6.orig/kernel/lockdep.c
+++ linux-2.6/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_recursi
* 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, st
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 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