aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-01-22 11:53:47 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-14 17:28:22 -0500
commitf510b233cfc7bfd57b6007071c52aa42e3d16b06 (patch)
treed7e91f4d82ee3bed078f5813377b73a1eb7e382f /kernel/lockdep.c
parent3ff176ca47911630d1555f150d36daa2d0819ea9 (diff)
lockdep: get_user_chars() redo
Generic, states independent, get_user_chars(). Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 1b4ee3c0b789..22ced8d4912f 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -487,25 +487,25 @@ static char get_usage_char(struct lock_class *class, enum lock_usage_bit bit)
487 return c; 487 return c;
488} 488}
489 489
490void 490void get_usage_chars(struct lock_class *class, char usage[LOCK_USAGE_CHARS])
491get_usage_chars(struct lock_class *class, char *c1, char *c2, char *c3,
492 char *c4, char *c5, char *c6)
493{ 491{
494 *c1 = get_usage_char(class, LOCK_USED_IN_HARDIRQ); 492 int i = 0;
495 *c2 = get_usage_char(class, LOCK_USED_IN_SOFTITQ);
496 *c3 = get_usage_char(class, LOCK_USED_IN_HARDIRQ_READ);
497 *c4 = get_usage_char(class, LOCK_USED_IN_SOFTITQ_READ);
498 493
499 *c5 = get_usage_char(class, LOCK_USED_IN_RECLAIM_FS); 494#define LOCKDEP_STATE(__STATE) \
500 *c6 = get_usage_char(class, LOCK_USED_IN_RECLAIM_FS_READ); 495 usage[i++] = get_usage_char(class, LOCK_USED_IN_##__STATE); \
496 usage[i++] = get_usage_char(class, LOCK_USED_IN_##__STATE##_READ);
497#include "lockdep_states.h"
498#undef LOCKDEP_STATE
499
500 usage[i] = '\0';
501} 501}
502 502
503static void print_lock_name(struct lock_class *class) 503static void print_lock_name(struct lock_class *class)
504{ 504{
505 char str[KSYM_NAME_LEN], c1, c2, c3, c4, c5, c6; 505 char str[KSYM_NAME_LEN], usage[LOCK_USAGE_CHARS];
506 const char *name; 506 const char *name;
507 507
508 get_usage_chars(class, &c1, &c2, &c3, &c4, &c5, &c6); 508 get_usage_chars(class, usage);
509 509
510 name = class->name; 510 name = class->name;
511 if (!name) { 511 if (!name) {
@@ -518,7 +518,7 @@ static void print_lock_name(struct lock_class *class)
518 if (class->subclass) 518 if (class->subclass)
519 printk("/%d", class->subclass); 519 printk("/%d", class->subclass);
520 } 520 }
521 printk("){%c%c%c%c%c%c}", c1, c2, c3, c4, c5, c6); 521 printk("){%s}", usage);
522} 522}
523 523
524static void print_lockdep_cache(struct lockdep_map *lock) 524static void print_lockdep_cache(struct lockdep_map *lock)