From: Ingo Molnar 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 Signed-off-by: Andrew Morton --- arch/arm/mach-pxa/corgi_ssp.c | 2 +- arch/ia64/kernel/perfmon.c | 2 +- arch/ia64/sn/kernel/xpnet.c | 2 +- arch/mips/kernel/gdb-stub.c | 2 +- arch/mips/kernel/genrtc.c | 2 +- arch/mips/kernel/i8259.c | 2 +- arch/ppc/platforms/hdpu.c | 2 +- arch/ppc/syslib/mv64x60.c | 2 +- arch/ppc/syslib/qspan_pci.c | 2 +- arch/ppc64/kernel/pmc.c | 2 +- arch/sparc/lib/atomic32.c | 2 +- drivers/net/mv643xx_eth.c | 2 +- drivers/parisc/iosapic.c | 2 +- drivers/scsi/ch.c | 2 +- drivers/video/backlight/corgi_bl.c | 2 +- drivers/video/geode/display_gx1.c | 2 +- fs/xfs/support/ktrace.c | 2 +- net/core/netpoll.c | 4 ++-- net/core/pktgen.c | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff -puN arch/arm/mach-pxa/corgi_ssp.c~more-spin_lock_unlocked-define_spinlock-conversions arch/arm/mach-pxa/corgi_ssp.c --- 25/arch/arm/mach-pxa/corgi_ssp.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/arm/mach-pxa/corgi_ssp.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN arch/ia64/kernel/perfmon.c~more-spin_lock_unlocked-define_spinlock-conversions arch/ia64/kernel/perfmon.c --- 25/arch/ia64/kernel/perfmon.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/ia64/kernel/perfmon.c 2005-06-25 01:17:34.000000000 -0700 @@ -498,7 +498,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 -puN arch/ia64/sn/kernel/xpnet.c~more-spin_lock_unlocked-define_spinlock-conversions arch/ia64/sn/kernel/xpnet.c --- 25/arch/ia64/sn/kernel/xpnet.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/ia64/sn/kernel/xpnet.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN arch/mips/kernel/gdb-stub.c~more-spin_lock_unlocked-define_spinlock-conversions arch/mips/kernel/gdb-stub.c --- 25/arch/mips/kernel/gdb-stub.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/mips/kernel/gdb-stub.c 2005-06-25 01:17:34.000000000 -0700 @@ -176,7 +176,7 @@ int kgdb_enabled; /* * spin locks for smp case */ -static spinlock_t kgdb_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(kgdb_lock); static spinlock_t kgdb_cpulock[NR_CPUS] = { [0 ... NR_CPUS-1] = SPIN_LOCK_UNLOCKED}; /* diff -puN arch/mips/kernel/genrtc.c~more-spin_lock_unlocked-define_spinlock-conversions arch/mips/kernel/genrtc.c --- 25/arch/mips/kernel/genrtc.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/mips/kernel/genrtc.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN arch/mips/kernel/i8259.c~more-spin_lock_unlocked-define_spinlock-conversions arch/mips/kernel/i8259.c --- 25/arch/mips/kernel/i8259.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/mips/kernel/i8259.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN arch/ppc64/kernel/pmc.c~more-spin_lock_unlocked-define_spinlock-conversions arch/ppc64/kernel/pmc.c --- 25/arch/ppc64/kernel/pmc.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/ppc64/kernel/pmc.c 2005-06-25 01:17:34.000000000 -0700 @@ -26,7 +26,7 @@ static void dummy_perf(struct pt_regs *r 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 -puN arch/ppc/platforms/hdpu.c~more-spin_lock_unlocked-define_spinlock-conversions arch/ppc/platforms/hdpu.c --- 25/arch/ppc/platforms/hdpu.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/ppc/platforms/hdpu.c 2005-06-25 01:17:34.000000000 -0700 @@ -58,7 +58,7 @@ static void parse_bootinfo(unsigned long 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 -puN arch/ppc/syslib/mv64x60.c~more-spin_lock_unlocked-define_spinlock-conversions arch/ppc/syslib/mv64x60.c --- 25/arch/ppc/syslib/mv64x60.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/ppc/syslib/mv64x60.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 = 0; static void *mv64x60_bridge_vbase = 0; diff -puN arch/ppc/syslib/qspan_pci.c~more-spin_lock_unlocked-define_spinlock-conversions arch/ppc/syslib/qspan_pci.c --- 25/arch/ppc/syslib/qspan_pci.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/ppc/syslib/qspan_pci.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN arch/sparc/lib/atomic32.c~more-spin_lock_unlocked-define_spinlock-conversions arch/sparc/lib/atomic32.c --- 25/arch/sparc/lib/atomic32.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/arch/sparc/lib/atomic32.c 2005-06-25 01:17:34.000000000 -0700 @@ -20,7 +20,7 @@ spinlock_t __atomic_hash[ATOMIC_HASH_SIZ #else /* SMP */ -static spinlock_t dummy = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dummy); #define ATOMIC_HASH_SIZE 1 #define ATOMIC_HASH(a) (&dummy) diff -puN drivers/net/mv643xx_eth.c~more-spin_lock_unlocked-define_spinlock-conversions drivers/net/mv643xx_eth.c --- 25/drivers/net/mv643xx_eth.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/drivers/net/mv643xx_eth.c 2005-06-25 01:17:34.000000000 -0700 @@ -95,7 +95,7 @@ static char mv643xx_driver_version[] = " 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 -puN drivers/parisc/iosapic.c~more-spin_lock_unlocked-define_spinlock-conversions drivers/parisc/iosapic.c --- 25/drivers/parisc/iosapic.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/drivers/parisc/iosapic.c 2005-06-25 01:17:34.000000000 -0700 @@ -215,7 +215,7 @@ static inline void iosapic_write(void __ #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 -puN drivers/scsi/ch.c~more-spin_lock_unlocked-define_spinlock-conversions drivers/scsi/ch.c --- 25/drivers/scsi/ch.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/drivers/scsi/ch.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN drivers/video/backlight/corgi_bl.c~more-spin_lock_unlocked-define_spinlock-conversions drivers/video/backlight/corgi_bl.c --- 25/drivers/video/backlight/corgi_bl.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/drivers/video/backlight/corgi_bl.c 2005-06-25 01:17:34.000000000 -0700 @@ -29,7 +29,7 @@ static int corgibl_powermode = FB_BLANK_UNBLANK; static int current_intensity = 0; static int corgibl_limit = 0; -static spinlock_t bl_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(bl_lock); static void corgibl_send_intensity(int intensity) { diff -puN drivers/video/geode/display_gx1.c~more-spin_lock_unlocked-define_spinlock-conversions drivers/video/geode/display_gx1.c --- 25/drivers/video/geode/display_gx1.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/drivers/video/geode/display_gx1.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN fs/xfs/support/ktrace.c~more-spin_lock_unlocked-define_spinlock-conversions fs/xfs/support/ktrace.c --- 25/fs/xfs/support/ktrace.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/fs/xfs/support/ktrace.c 2005-06-25 01:17:34.000000000 -0700 @@ -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 -puN net/core/netpoll.c~more-spin_lock_unlocked-define_spinlock-conversions net/core/netpoll.c --- 25/net/core/netpoll.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/net/core/netpoll.c 2005-06-25 01:17:34.000000000 -0700 @@ -640,9 +640,9 @@ int netpoll_setup(struct netpoll *np) goto release; npinfo->rx_np = NULL; - npinfo->poll_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&npinfo->poll_lock); npinfo->poll_owner = -1; - npinfo->rx_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&npinfo->rx_lock); } else npinfo = ndev->npinfo; diff -puN net/core/pktgen.c~more-spin_lock_unlocked-define_spinlock-conversions net/core/pktgen.c --- 25/net/core/pktgen.c~more-spin_lock_unlocked-define_spinlock-conversions 2005-06-25 01:17:34.000000000 -0700 +++ 25-akpm/net/core/pktgen.c 2005-06-25 01:17:34.000000000 -0700 @@ -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]; _