Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] more SPIN_LOCK_UNLOCKED -> DEFINE_SPINLOCK conversions

This converts the final 20 DEFINE_SPINLOCK holdouts. (another 580 places
are already using DEFINE_SPINLOCK). Build tested on x86.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Ingo Molnar and committed by
Linus Torvalds
a9f6a0dd 8d06afab

+18 -18
+1 -1
arch/arm/mach-pxa/corgi_ssp.c
··· 22 22 #include <asm/arch/corgi.h> 23 23 #include <asm/arch/pxa-regs.h> 24 24 25 - static spinlock_t corgi_ssp_lock = SPIN_LOCK_UNLOCKED; 25 + static DEFINE_SPINLOCK(corgi_ssp_lock); 26 26 static struct ssp_dev corgi_ssp_dev; 27 27 static struct ssp_state corgi_ssp_state; 28 28
+1 -1
arch/ia64/kernel/perfmon.c
··· 497 497 static pfm_stats_t pfm_stats[NR_CPUS]; 498 498 static pfm_session_t pfm_sessions; /* global sessions information */ 499 499 500 - static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED; 500 + static DEFINE_SPINLOCK(pfm_alt_install_check); 501 501 static pfm_intr_handler_desc_t *pfm_alt_intr_handler; 502 502 503 503 static struct proc_dir_entry *perfmon_dir;
+1 -1
arch/ia64/sn/kernel/xpnet.c
··· 130 130 */ 131 131 static u64 xpnet_broadcast_partitions; 132 132 /* protect above */ 133 - static spinlock_t xpnet_broadcast_lock = SPIN_LOCK_UNLOCKED; 133 + static DEFINE_SPINLOCK(xpnet_broadcast_lock); 134 134 135 135 /* 136 136 * Since the Block Transfer Engine (BTE) is being used for the transfer
+1 -1
arch/mips/kernel/genrtc.c
··· 14 14 #include <asm/rtc.h> 15 15 #include <asm/time.h> 16 16 17 - static spinlock_t mips_rtc_lock = SPIN_LOCK_UNLOCKED; 17 + static DEFINE_SPINLOCK(mips_rtc_lock); 18 18 19 19 unsigned int get_rtc_time(struct rtc_time *time) 20 20 {
+1 -1
arch/mips/kernel/i8259.c
··· 31 31 * moves to arch independent land 32 32 */ 33 33 34 - spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED; 34 + spinlock_t DEFINE_SPINLOCK(i8259A_lock); 35 35 36 36 static void end_8259A_irq (unsigned int irq) 37 37 {
+1 -1
arch/ppc/platforms/hdpu.c
··· 58 58 static void hdpu_set_l1pe(void); 59 59 static void hdpu_cpustate_set(unsigned char new_state); 60 60 #ifdef CONFIG_SMP 61 - static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; 61 + static DEFINE_SPINLOCK(timebase_lock); 62 62 static unsigned int timebase_upper = 0, timebase_lower = 0; 63 63 extern int smp_tb_synchronized; 64 64
+1 -1
arch/ppc/syslib/mv64x60.c
··· 31 31 32 32 33 33 u8 mv64x60_pci_exclude_bridge = 1; 34 - spinlock_t mv64x60_lock = SPIN_LOCK_UNLOCKED; 34 + DEFINE_SPINLOCK(mv64x60_lock); 35 35 36 36 static phys_addr_t mv64x60_bridge_pbase; 37 37 static void *mv64x60_bridge_vbase;
+1 -1
arch/ppc/syslib/qspan_pci.c
··· 94 94 #define mk_config_type1(bus, dev, offset) \ 95 95 mk_config_addr(bus, dev, offset) | 1; 96 96 97 - static spinlock_t pcibios_lock = SPIN_LOCK_UNLOCKED; 97 + static DEFINE_SPINLOCK(pcibios_lock); 98 98 99 99 int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, 100 100 unsigned char offset, unsigned char *val)
+1 -1
arch/ppc64/kernel/pmc.c
··· 26 26 mtspr(SPRN_MMCR0, mmcr0); 27 27 } 28 28 29 - static spinlock_t pmc_owner_lock = SPIN_LOCK_UNLOCKED; 29 + static DEFINE_SPINLOCK(pmc_owner_lock); 30 30 static void *pmc_owner_caller; /* mostly for debugging */ 31 31 perf_irq_t perf_irq = dummy_perf; 32 32
+1 -1
arch/sparc/lib/atomic32.c
··· 20 20 21 21 #else /* SMP */ 22 22 23 - static spinlock_t dummy = SPIN_LOCK_UNLOCKED; 23 + static DEFINE_SPINLOCK(dummy); 24 24 #define ATOMIC_HASH_SIZE 1 25 25 #define ATOMIC_HASH(a) (&dummy) 26 26
+1 -1
drivers/net/mv643xx_eth.c
··· 94 94 static void __iomem *mv643xx_eth_shared_base; 95 95 96 96 /* used to protect MV643XX_ETH_SMI_REG, which is shared across ports */ 97 - static spinlock_t mv643xx_eth_phy_lock = SPIN_LOCK_UNLOCKED; 97 + static DEFINE_SPINLOCK(mv643xx_eth_phy_lock); 98 98 99 99 static inline u32 mv_read(int offset) 100 100 {
+1 -1
drivers/parisc/iosapic.c
··· 215 215 #define IOSAPIC_IRDT_ID_EID_SHIFT 0x10 216 216 217 217 218 - static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED; 218 + static DEFINE_SPINLOCK(iosapic_lock); 219 219 220 220 static inline void iosapic_eoi(void __iomem *addr, unsigned int data) 221 221 {
+1 -1
drivers/scsi/ch.c
··· 116 116 } scsi_changer; 117 117 118 118 static LIST_HEAD(ch_devlist); 119 - static spinlock_t ch_devlist_lock = SPIN_LOCK_UNLOCKED; 119 + static DEFINE_SPINLOCK(ch_devlist_lock); 120 120 static int ch_devcount; 121 121 122 122 static struct scsi_driver ch_template =
+1 -1
drivers/video/geode/display_gx1.c
··· 22 22 #include "geodefb.h" 23 23 #include "display_gx1.h" 24 24 25 - static spinlock_t gx1_conf_reg_lock = SPIN_LOCK_UNLOCKED; 25 + static DEFINE_SPINLOCK(gx1_conf_reg_lock); 26 26 27 27 static u8 gx1_read_conf_reg(u8 reg) 28 28 {
+1 -1
fs/xfs/support/ktrace.c
··· 170 170 void *val14, 171 171 void *val15) 172 172 { 173 - static lock_t wrap_lock = SPIN_LOCK_UNLOCKED; 173 + static DEFINE_SPINLOCK(wrap_lock); 174 174 unsigned long flags; 175 175 int index; 176 176 ktrace_entry_t *ktep;
+2 -2
net/core/netpoll.c
··· 645 645 646 646 npinfo->rx_flags = 0; 647 647 npinfo->rx_np = NULL; 648 - npinfo->poll_lock = SPIN_LOCK_UNLOCKED; 648 + spin_lock_init(&npinfo->poll_lock); 649 649 npinfo->poll_owner = -1; 650 650 npinfo->tries = MAX_RETRIES; 651 - npinfo->rx_lock = SPIN_LOCK_UNLOCKED; 651 + spin_lock_init(&npinfo->rx_lock); 652 652 } else 653 653 npinfo = ndev->npinfo; 654 654
+1 -1
net/core/pktgen.c
··· 503 503 static int pg_clone_skb_d = 0; 504 504 static int debug = 0; 505 505 506 - static spinlock_t _thread_lock = SPIN_LOCK_UNLOCKED; 506 + static DEFINE_SPINLOCK(_thread_lock); 507 507 static struct pktgen_thread *pktgen_threads = NULL; 508 508 509 509 static char module_fname[128];