diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-12-12 06:10:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-12 11:10:44 -0500 |
commit | 99a3eb3845f034eb55640a3da73e5e28349678c6 (patch) | |
tree | 9a6704ac9d8bb0ab2b3649cb05999daa0e96175c /include | |
parent | d907dd2efd69195f4a5fc584a0eaecc599ca4c2c (diff) |
[PATCH] lockdep: fix seqlock_init()
seqlock_init() needs to use spin_lock_init() for dynamic locks, so that
lockdep is notified about the presence of a new lock.
(this is a fallout of the recent networking merge, which started using
the so-far unused seqlock_init() API.)
This fix solves the following lockdep-internal warning on current -git:
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
__lock_acquire+0x10c/0x9f9
lock_acquire+0x56/0x72
_spin_lock+0x35/0x42
neigh_destroy+0x9d/0x12e
neigh_periodic_timer+0x10a/0x15c
run_timer_softirq+0x126/0x18e
__do_softirq+0x6b/0xe6
do_softirq+0x64/0xd2
ksoftirqd+0x82/0x138
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/seqlock.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 46000936f8f..6b0648cfdff 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -44,8 +44,11 @@ typedef struct { | |||
44 | #define SEQLOCK_UNLOCKED \ | 44 | #define SEQLOCK_UNLOCKED \ |
45 | __SEQLOCK_UNLOCKED(old_style_seqlock_init) | 45 | __SEQLOCK_UNLOCKED(old_style_seqlock_init) |
46 | 46 | ||
47 | #define seqlock_init(x) \ | 47 | #define seqlock_init(x) \ |
48 | do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0) | 48 | do { \ |
49 | (x)->sequence = 0; \ | ||
50 | spin_lock_init(&(x)->lock); \ | ||
51 | } while (0) | ||
49 | 52 | ||
50 | #define DEFINE_SEQLOCK(x) \ | 53 | #define DEFINE_SEQLOCK(x) \ |
51 | seqlock_t x = __SEQLOCK_UNLOCKED(x) | 54 | seqlock_t x = __SEQLOCK_UNLOCKED(x) |