Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f07fdec5 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

lockdep/waitqueues: Add better annotation



 -> #2 (&tty->write_wait){-.-...}:

is a lot more informative than:

 -> #2 (key#19){-.....}:

Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-8zpopbny51023rdb0qq67eye@git.kernel.org


Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2d2b7749
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -77,13 +77,13 @@ struct task_struct;
#define __WAIT_BIT_KEY_INITIALIZER(word, bit)				\
	{ .flags = word, .bit_nr = bit, }

extern void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *);
extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *);

#define init_waitqueue_head(q)				\
	do {						\
		static struct lock_class_key __key;	\
							\
		__init_waitqueue_head((q), &__key);	\
		__init_waitqueue_head((q), #q, &__key);	\
	} while (0)

#ifdef CONFIG_LOCKDEP
+2 −2
Original line number Diff line number Diff line
@@ -10,10 +10,10 @@
#include <linux/wait.h>
#include <linux/hash.h>

void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *key)
void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *key)
{
	spin_lock_init(&q->lock);
	lockdep_set_class(&q->lock, key);
	lockdep_set_class_and_name(&q->lock, key, name);
	INIT_LIST_HEAD(&q->task_list);
}