Commit 194d058f authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

[PATCH] Lock initializer cleanup: I386

Use the new lock initializers DEFINE_SPIN_LOCK and DEFINE_RW_LOCK
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bc69b69f
......@@ -424,7 +424,7 @@ static int broken_psr;
static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
static struct apm_user * user_list;
static spinlock_t user_list_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(user_list_lock);
static struct desc_struct bad_bios_desc = { 0, 0x00409200 };
static char driver_version[] = "1.16ac"; /* no spaces */
......
......@@ -231,7 +231,7 @@ static unsigned long set_mtrr_state(u32 deftype_lo, u32 deftype_hi)
static unsigned long cr4 = 0;
static u32 deftype_lo, deftype_hi;
static spinlock_t set_atomicity_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(set_atomicity_lock);
/*
* Since we are disabling the cache don't allow any interrupts - they
......
......@@ -62,7 +62,7 @@ extern void * boot_ioremap(unsigned long, unsigned long);
*/
static unsigned long efi_rt_eflags;
static spinlock_t efi_rt_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(efi_rt_lock);
static pgd_t efi_bak_pg_dir_pointer[2];
static void efi_call_phys_prelog(void)
......
......@@ -38,7 +38,7 @@
* moves to arch independent land
*/
spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED;
DEFINE_SPINLOCK(i8259A_lock);
static void end_8259A_irq (unsigned int irq)
{
......
......@@ -45,7 +45,7 @@
int (*ioapic_renumber_irq)(int ioapic, int irq);
atomic_t irq_mis_count;
static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(ioapic_lock);
/*
* Is the SiS APIC rmw bug present ?
......
......@@ -65,7 +65,7 @@ EXPORT_SYMBOL(MCA_bus);
*
* Yes - Alan
*/
static spinlock_t mca_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(mca_lock);
/* Build the status info for the adapter */
......
......@@ -109,7 +109,7 @@ MODULE_LICENSE("GPL");
#define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE)
/* serialize access to the physical write to MSR 0x79 */
static spinlock_t microcode_update_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(microcode_update_lock);
/* no concurrent ->write()s are allowed on /dev/cpu/microcode */
static DECLARE_MUTEX(microcode_sem);
......
......@@ -50,7 +50,7 @@ extern void show_registers(struct pt_regs *regs);
* This is maintained separately from nmi_active because the NMI
* watchdog may also be driven from the I/O APIC timer.
*/
static spinlock_t lapic_nmi_owner_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(lapic_nmi_owner_lock);
static unsigned int lapic_nmi_owner;
#define LAPIC_NMI_WATCHDOG (1<<0)
#define LAPIC_NMI_RESERVED (1<<1)
......
......@@ -37,8 +37,8 @@ static struct pci_driver scx200_pci_driver = {
.probe = scx200_probe,
};
spinlock_t scx200_gpio_lock = SPIN_LOCK_UNLOCKED;
static spinlock_t scx200_gpio_config_lock = SPIN_LOCK_UNLOCKED;
DEFINE_SPINLOCK(scx200_gpio_lock);
static DEFINE_SPINLOCK(scx200_gpio_config_lock);
static int __devinit scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
......
......@@ -244,7 +244,7 @@ inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
static cpumask_t flush_cpumask;
static struct mm_struct * flush_mm;
static unsigned long flush_va;
static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(tlbstate_lock);
#define FLUSH_ALL 0xffffffff
/*
......@@ -481,7 +481,7 @@ void smp_send_reschedule(int cpu)
* Structure and data for smp_call_function(). This is designed to minimise
* static memory requirements. It also looks cleaner.
*/
static spinlock_t call_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(call_lock);
struct call_data_struct {
void (*func) (void *info);
......
......@@ -81,9 +81,9 @@ unsigned long cpu_khz; /* Detected as we calibrate the TSC */
extern unsigned long wall_jiffies;
spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
DEFINE_SPINLOCK(rtc_lock);
spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED;
DEFINE_SPINLOCK(i8253_lock);
EXPORT_SYMBOL(i8253_lock);
struct timer_opts *cur_timer = &timer_none;
......
......@@ -93,7 +93,7 @@ asmlinkage void machine_check(void);
static int kstack_depth_to_print = 24;
struct notifier_block *i386die_chain;
static spinlock_t die_notifier_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(die_notifier_lock);
int register_die_notifier(struct notifier_block *nb)
{
......@@ -551,7 +551,7 @@ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
printk("Do you have a strange power saving mode enabled?\n");
}
static spinlock_t nmi_print_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(nmi_print_lock);
void die_nmi (struct pt_regs *regs, const char *msg)
{
......
......@@ -713,7 +713,7 @@ static struct vm86_irqs {
int sig;
} vm86_irqs[16];
static spinlock_t irqbits_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(irqbits_lock);
static int irqbits;
#define ALLOWED_SIGS ( 1 /* 0 = don't send a signal */ \
......
......@@ -31,7 +31,7 @@
#include "irq_vectors.h"
static spinlock_t cobalt_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(cobalt_lock);
/*
* Set the given Cobalt APIC Redirection Table entry to point
......
......@@ -254,7 +254,7 @@ static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned;
static __u16 vic_irq_enable_mask[NR_CPUS] __cacheline_aligned = { 0 };
/* Lock for enable/disable of VIC interrupts */
static spinlock_t vic_irq_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED;
static __cacheline_aligned DEFINE_SPINLOCK(vic_irq_lock);
/* The boot processor is correctly set up in PC mode when it
* comes up, but the secondaries need their master/slave 8259
......@@ -798,7 +798,7 @@ fastcall void
smp_vic_cmn_interrupt(struct pt_regs *regs)
{
static __u8 in_cmn_int = 0;
static spinlock_t cmn_int_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(cmn_int_lock);
/* common ints are broadcast, so make sure we only do this once */
_raw_spin_lock(&cmn_int_lock);
......@@ -831,7 +831,7 @@ smp_reschedule_interrupt(void)
static struct mm_struct * flush_mm;
static unsigned long flush_va;
static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(tlbstate_lock);
#define FLUSH_ALL 0xffffffff
/*
......@@ -1021,7 +1021,7 @@ smp_stop_cpu_function(void *dummy)
__asm__("hlt");
}
static spinlock_t call_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(call_lock);
struct call_data_struct {
void (*func) (void *info);
......
......@@ -13,7 +13,7 @@
#include <asm/processor.h>
#include <asm/tlbflush.h>
static spinlock_t cpa_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(cpa_lock);
static struct list_head df_list = LIST_HEAD_INIT(df_list);
......
......@@ -172,7 +172,7 @@ void pmd_ctor(void *pmd, kmem_cache_t *cache, unsigned long flags)
* recommendations and having no core impact whatsoever.
* -- wli
*/
spinlock_t pgd_lock = SPIN_LOCK_UNLOCKED;
DEFINE_SPINLOCK(pgd_lock);
struct page *pgd_list;
static inline void pgd_list_add(pgd_t *pgd)
......
......@@ -53,7 +53,7 @@ int pcibios_scanned;
* This interrupt-safe spinlock protects all accesses to PCI
* configuration space.
*/
spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
DEFINE_SPINLOCK(pci_config_lock);
/*
* Several buggy motherboards address only 16 devices and mirror
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment