diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c index 8ccffba0018fa5f1ef5d607c0be447ffc1dacd4c..366a9bde3d8be08880231795926d834839d35ddc 100644 --- a/arch/arm/mach-pxa/corgi_ssp.c +++ b/arch/arm/mach-pxa/corgi_ssp.c @@ -22,7 +22,7 @@ #include #include -static spinlock_t corgi_ssp_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(corgi_ssp_lock); static struct ssp_dev corgi_ssp_dev; static struct ssp_state corgi_ssp_state; diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 4ad97b3b39dcc904f24a502576d62b3979edbabf..1650353e3f77ef40cdf5ab96e4642e67eb8b4190 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -497,7 +497,7 @@ typedef struct { static pfm_stats_t pfm_stats[NR_CPUS]; static pfm_session_t pfm_sessions; /* global sessions information */ -static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pfm_alt_install_check); static pfm_intr_handler_desc_t *pfm_alt_intr_handler; static struct proc_dir_entry *perfmon_dir; diff --git a/arch/ia64/sn/kernel/xpnet.c b/arch/ia64/sn/kernel/xpnet.c index d0c2c114a459a5c694402e540eb7468afb137dec..e5c6d3c0a8e9a852ac37ae43e620ffa820bc0b05 100644 --- a/arch/ia64/sn/kernel/xpnet.c +++ b/arch/ia64/sn/kernel/xpnet.c @@ -130,7 +130,7 @@ struct net_device *xpnet_device; */ static u64 xpnet_broadcast_partitions; /* protect above */ -static spinlock_t xpnet_broadcast_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(xpnet_broadcast_lock); /* * Since the Block Transfer Engine (BTE) is being used for the transfer diff --git a/arch/mips/kernel/genrtc.c b/arch/mips/kernel/genrtc.c index 288bf51ad4ecd3c2da322ac3c658b39816a339b8..71416e7bbbaa380ff0be20cd167ab8065b7c8601 100644 --- a/arch/mips/kernel/genrtc.c +++ b/arch/mips/kernel/genrtc.c @@ -14,7 +14,7 @@ #include #include -static spinlock_t mips_rtc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mips_rtc_lock); unsigned int get_rtc_time(struct rtc_time *time) { diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c index 7eec7568bfea593465d9958e85c452d584a7dedf..447759201d1ddb5669d3052d45f4c4a0568423b9 100644 --- a/arch/mips/kernel/i8259.c +++ b/arch/mips/kernel/i8259.c @@ -31,7 +31,7 @@ void disable_8259A_irq(unsigned int irq); * moves to arch independent land */ -spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED; +spinlock_t DEFINE_SPINLOCK(i8259A_lock); static void end_8259A_irq (unsigned int irq) { diff --git a/arch/ppc/platforms/hdpu.c b/arch/ppc/platforms/hdpu.c index b659d7b3d7477a8e9c520eac236b785a32637142..ff3796860123ae46ec899ea5da0a9afcaeeb7bdd 100644 --- a/arch/ppc/platforms/hdpu.c +++ b/arch/ppc/platforms/hdpu.c @@ -58,7 +58,7 @@ static void parse_bootinfo(unsigned long r3, static void hdpu_set_l1pe(void); static void hdpu_cpustate_set(unsigned char new_state); #ifdef CONFIG_SMP -static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(timebase_lock); static unsigned int timebase_upper = 0, timebase_lower = 0; extern int smp_tb_synchronized; diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c index 6262b11f366f713eaf228ca10bb6e77ef206bb82..839f8872826f40480088397ddb9da28f716f1356 100644 --- a/arch/ppc/syslib/mv64x60.c +++ b/arch/ppc/syslib/mv64x60.c @@ -31,7 +31,7 @@ u8 mv64x60_pci_exclude_bridge = 1; -spinlock_t mv64x60_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(mv64x60_lock); static phys_addr_t mv64x60_bridge_pbase; static void *mv64x60_bridge_vbase; diff --git a/arch/ppc/syslib/qspan_pci.c b/arch/ppc/syslib/qspan_pci.c index 57f4ed5e5ae1a1b6dbab371f5590409c0fa2b20d..0970b5d30391553877a031eab1f5e3ec8e790d9d 100644 --- a/arch/ppc/syslib/qspan_pci.c +++ b/arch/ppc/syslib/qspan_pci.c @@ -94,7 +94,7 @@ #define mk_config_type1(bus, dev, offset) \ mk_config_addr(bus, dev, offset) | 1; -static spinlock_t pcibios_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pcibios_lock); int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned char *val) diff --git a/arch/ppc64/kernel/pmc.c b/arch/ppc64/kernel/pmc.c index cdfec7438d0132334f17b65ec539fa919c997b91..63d9481c3ec2f7548cda86435c5b6a1311292b0f 100644 --- a/arch/ppc64/kernel/pmc.c +++ b/arch/ppc64/kernel/pmc.c @@ -26,7 +26,7 @@ static void dummy_perf(struct pt_regs *regs) mtspr(SPRN_MMCR0, mmcr0); } -static spinlock_t pmc_owner_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(pmc_owner_lock); static void *pmc_owner_caller; /* mostly for debugging */ perf_irq_t perf_irq = dummy_perf; diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c index 19724c5800a79e48c23704e03af3668a691bb332..2e64e8c3e8e54c1aafbe66e34d3d64cf0f96f895 100644 --- a/arch/sparc/lib/atomic32.c +++ b/arch/sparc/lib/atomic32.c @@ -20,7 +20,7 @@ spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = { #else /* SMP */ -static spinlock_t dummy = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dummy); #define ATOMIC_HASH_SIZE 1 #define ATOMIC_HASH(a) (&dummy) diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 7c9dbc8c9423ae005a5be12175dc3c33397b367c..25c9a99c377b12142f5014b6e28216a7b5f5e55a 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -94,7 +94,7 @@ static char mv643xx_driver_version[] = "1.0"; static void __iomem *mv643xx_eth_shared_base; /* used to protect MV643XX_ETH_SMI_REG, which is shared across ports */ -static spinlock_t mv643xx_eth_phy_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mv643xx_eth_phy_lock); static inline u32 mv_read(int offset) { diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 91df0bf181ddf7b6d3e9d889af3e7d2714b1ba22..7a57c1b8373f04438a996f05242c8070651c481b 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -215,7 +215,7 @@ static inline void iosapic_write(void __iomem *iosapic, unsigned int reg, u32 va #define IOSAPIC_IRDT_ID_EID_SHIFT 0x10 -static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(iosapic_lock); static inline void iosapic_eoi(void __iomem *addr, unsigned int data) { diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index bd0e1b6be1ea6d50badb9e13c7717de66332e1d3..13ecd0c4740434b36f06603d9deea98bf1ce24e5 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -116,7 +116,7 @@ typedef struct { } scsi_changer; static LIST_HEAD(ch_devlist); -static spinlock_t ch_devlist_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ch_devlist_lock); static int ch_devcount; static struct scsi_driver ch_template = diff --git a/drivers/video/geode/display_gx1.c b/drivers/video/geode/display_gx1.c index f4983879fcc4b60a25aeeb203b0e0d8a2fde2334..926d53eeb54952c48ea41dd787149c72fb87ea5c 100644 --- a/drivers/video/geode/display_gx1.c +++ b/drivers/video/geode/display_gx1.c @@ -22,7 +22,7 @@ #include "geodefb.h" #include "display_gx1.h" -static spinlock_t gx1_conf_reg_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(gx1_conf_reg_lock); static u8 gx1_read_conf_reg(u8 reg) { diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c index 3dae14c8c55a14eef89683f713e4b5af5f618c2f..fa8394f9437d4bafd80c8ac88f291cfb38e76468 100644 --- a/fs/xfs/support/ktrace.c +++ b/fs/xfs/support/ktrace.c @@ -170,7 +170,7 @@ ktrace_enter( void *val14, void *val15) { - static lock_t wrap_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(wrap_lock); unsigned long flags; int index; ktrace_entry_t *ktep; diff --git a/net/core/netpoll.c b/net/core/netpoll.c index a1a9a7abff50981c1e26fdcca3d2b7b2fa315d59..5265dfd699284a960c5fd95b33a6daf722b1a0bc 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -645,10 +645,10 @@ int netpoll_setup(struct netpoll *np) npinfo->rx_flags = 0; npinfo->rx_np = NULL; - npinfo->poll_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&npinfo->poll_lock); npinfo->poll_owner = -1; npinfo->tries = MAX_RETRIES; - npinfo->rx_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&npinfo->rx_lock); } else npinfo = ndev->npinfo; diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 8eb083b6041a7fae844be27a29e9082e828587cc..b3ad49fa7d787ad7d8a01feb7a1a62f3faaa0bd9 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -503,7 +503,7 @@ static int pg_delay_d = 0; static int pg_clone_skb_d = 0; static int debug = 0; -static spinlock_t _thread_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(_thread_lock); static struct pktgen_thread *pktgen_threads = NULL; static char module_fname[128];