diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-06-27 05:53:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 20:32:39 -0400 |
commit | 34af946a22724c4e2b204957f2b24b22a0fb121c (patch) | |
tree | 7881dcbd0a698257c126198cdb6d97d4e45ee51e /arch | |
parent | b6cd0b772dcc5dc9b4c03d53946474dee399fa72 (diff) |
[PATCH] spin/rwlock init cleanups
locking init cleanups:
- convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
- convert rwlocks in a similar manner
this patch was generated automatically.
Motivation:
- cleanliness
- lockdep needs control of lock initialization, which the open-coded
variants do not give
- it's also useful for -rt and for lock debugging in general
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/sn/kernel/irq.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/smtc.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/switch.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pfunc_core.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_event.c | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mmio_nvram.c | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/time.c | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/traps.c | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index dc8e2b696713..677c6c0fd661 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
@@ -27,7 +27,7 @@ static void unregister_intr_pda(struct sn_irq_info *sn_irq_info); | |||
27 | int sn_force_interrupt_flag = 1; | 27 | int sn_force_interrupt_flag = 1; |
28 | extern int sn_ioif_inited; | 28 | extern int sn_ioif_inited; |
29 | struct list_head **sn_irq_lh; | 29 | struct list_head **sn_irq_lh; |
30 | static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */ | 30 | static DEFINE_SPINLOCK(sn_irq_info_lock); /* non-IRQ lock */ |
31 | 31 | ||
32 | u64 sn_intr_alloc(nasid_t local_nasid, int local_widget, | 32 | u64 sn_intr_alloc(nasid_t local_nasid, int local_widget, |
33 | struct sn_irq_info *sn_irq_info, | 33 | struct sn_irq_info *sn_irq_info, |
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 2e8e52c135e6..70cf09afdf56 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -367,7 +367,7 @@ void mipsmt_prepare_cpus(void) | |||
367 | dvpe(); | 367 | dvpe(); |
368 | dmt(); | 368 | dmt(); |
369 | 369 | ||
370 | freeIPIq.lock = SPIN_LOCK_UNLOCKED; | 370 | spin_lock_init(&freeIPIq.lock); |
371 | 371 | ||
372 | /* | 372 | /* |
373 | * We probably don't have as many VPEs as we do SMP "CPUs", | 373 | * We probably don't have as many VPEs as we do SMP "CPUs", |
@@ -375,7 +375,7 @@ void mipsmt_prepare_cpus(void) | |||
375 | */ | 375 | */ |
376 | for (i=0; i<NR_CPUS; i++) { | 376 | for (i=0; i<NR_CPUS; i++) { |
377 | IPIQ[i].head = IPIQ[i].tail = NULL; | 377 | IPIQ[i].head = IPIQ[i].tail = NULL; |
378 | IPIQ[i].lock = SPIN_LOCK_UNLOCKED; | 378 | spin_lock_init(&IPIQ[i].lock); |
379 | IPIQ[i].depth = 0; | 379 | IPIQ[i].depth = 0; |
380 | ipi_timer_latch[i] = 0; | 380 | ipi_timer_latch[i] = 0; |
381 | } | 381 | } |
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c index 3068b429b031..a656d810a44a 100644 --- a/arch/powerpc/platforms/cell/spufs/switch.c +++ b/arch/powerpc/platforms/cell/spufs/switch.c | |||
@@ -2203,7 +2203,7 @@ void spu_init_csa(struct spu_state *csa) | |||
2203 | 2203 | ||
2204 | memset(lscsa, 0, sizeof(struct spu_lscsa)); | 2204 | memset(lscsa, 0, sizeof(struct spu_lscsa)); |
2205 | csa->lscsa = lscsa; | 2205 | csa->lscsa = lscsa; |
2206 | csa->register_lock = SPIN_LOCK_UNLOCKED; | 2206 | spin_lock_init(&csa->register_lock); |
2207 | 2207 | ||
2208 | /* Set LS pages reserved to allow for user-space mapping. */ | 2208 | /* Set LS pages reserved to allow for user-space mapping. */ |
2209 | for (p = lscsa->ls; p < lscsa->ls + LS_SIZE; p += PAGE_SIZE) | 2209 | for (p = lscsa->ls; p < lscsa->ls + LS_SIZE; p += PAGE_SIZE) |
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index 047f954a89eb..93e7505debc5 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
@@ -546,7 +546,7 @@ struct pmf_device { | |||
546 | }; | 546 | }; |
547 | 547 | ||
548 | static LIST_HEAD(pmf_devices); | 548 | static LIST_HEAD(pmf_devices); |
549 | static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED; | 549 | static DEFINE_SPINLOCK(pmf_lock); |
550 | static DEFINE_MUTEX(pmf_irq_mutex); | 550 | static DEFINE_MUTEX(pmf_irq_mutex); |
551 | 551 | ||
552 | static void pmf_release_device(struct kref *kref) | 552 | static void pmf_release_device(struct kref *kref) |
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c index 8f2d12935b99..45ccc687e57c 100644 --- a/arch/powerpc/platforms/pseries/eeh_event.c +++ b/arch/powerpc/platforms/pseries/eeh_event.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | /* EEH event workqueue setup. */ | 37 | /* EEH event workqueue setup. */ |
38 | static spinlock_t eeh_eventlist_lock = SPIN_LOCK_UNLOCKED; | 38 | static DEFINE_SPINLOCK(eeh_eventlist_lock); |
39 | LIST_HEAD(eeh_eventlist); | 39 | LIST_HEAD(eeh_eventlist); |
40 | static void eeh_thread_launcher(void *); | 40 | static void eeh_thread_launcher(void *); |
41 | DECLARE_WORK(eeh_event_wq, eeh_thread_launcher, NULL); | 41 | DECLARE_WORK(eeh_event_wq, eeh_thread_launcher, NULL); |
diff --git a/arch/powerpc/sysdev/mmio_nvram.c b/arch/powerpc/sysdev/mmio_nvram.c index 74e0d31a3559..615350d46b52 100644 --- a/arch/powerpc/sysdev/mmio_nvram.c +++ b/arch/powerpc/sysdev/mmio_nvram.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | static void __iomem *mmio_nvram_start; | 33 | static void __iomem *mmio_nvram_start; |
34 | static long mmio_nvram_len; | 34 | static long mmio_nvram_len; |
35 | static spinlock_t mmio_nvram_lock = SPIN_LOCK_UNLOCKED; | 35 | static DEFINE_SPINLOCK(mmio_nvram_lock); |
36 | 36 | ||
37 | static ssize_t mmio_nvram_read(char *buf, size_t count, loff_t *index) | 37 | static ssize_t mmio_nvram_read(char *buf, size_t count, loff_t *index) |
38 | { | 38 | { |
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index 937d81f62f43..fe14909f45e0 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | extern volatile unsigned long wall_jiffies; | 30 | extern volatile unsigned long wall_jiffies; |
31 | 31 | ||
32 | spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; | 32 | DEFINE_SPINLOCK(rtc_lock); |
33 | EXPORT_SYMBOL(rtc_lock); | 33 | EXPORT_SYMBOL(rtc_lock); |
34 | 34 | ||
35 | 35 | ||
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 225d64d73f04..27e409089a7b 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c | |||
@@ -461,7 +461,7 @@ void show_code(unsigned int *pc) | |||
461 | } | 461 | } |
462 | } | 462 | } |
463 | 463 | ||
464 | spinlock_t die_lock = SPIN_LOCK_UNLOCKED; | 464 | DEFINE_SPINLOCK(die_lock); |
465 | 465 | ||
466 | void die(const char * str, struct pt_regs * regs, long err) | 466 | void die(const char * str, struct pt_regs * regs, long err) |
467 | { | 467 | { |