Commit c254df93 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

[PATCH] Lock initializer cleanup (character devices)

Character devices converted to use the new lock initializers.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 59d086c5
...@@ -68,7 +68,7 @@ static int ds1286_set_time(struct rtc_time *rtc_tm); ...@@ -68,7 +68,7 @@ static int ds1286_set_time(struct rtc_time *rtc_tm);
static inline unsigned char ds1286_is_updating(void); static inline unsigned char ds1286_is_updating(void);
static spinlock_t ds1286_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(ds1286_lock);
static int ds1286_read_proc(char *page, char **start, off_t off, static int ds1286_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data); int count, int *eof, void *data);
......
...@@ -92,7 +92,7 @@ static void aux_write_ack(int val); ...@@ -92,7 +92,7 @@ static void aux_write_ack(int val);
static void __aux_write_ack(int val); static void __aux_write_ack(int val);
#endif #endif
static spinlock_t kbd_controller_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(kbd_controller_lock);
static unsigned char handle_kbd_event(void); static unsigned char handle_kbd_event(void);
/* used only by send_data - set by keyboard_interrupt */ /* used only by send_data - set by keyboard_interrupt */
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
*/ */
#define EFI_RTC_EPOCH 1998 #define EFI_RTC_EPOCH 1998
static spinlock_t efi_rtc_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(efi_rtc_lock);
static int efi_rtc_ioctl(struct inode *inode, struct file *file, static int efi_rtc_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
......
...@@ -95,7 +95,7 @@ static void gen_rtc_timer(unsigned long data); ...@@ -95,7 +95,7 @@ static void gen_rtc_timer(unsigned long data);
static volatile int stask_active; /* schedule_work */ static volatile int stask_active; /* schedule_work */
static volatile int ttask_active; /* timer_task */ static volatile int ttask_active; /* timer_task */
static int stop_rtc_timers; /* don't requeue tasks */ static int stop_rtc_timers; /* don't requeue tasks */
static spinlock_t gen_rtc_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(gen_rtc_lock);
static void gen_rtc_interrupt(unsigned long arg); static void gen_rtc_interrupt(unsigned long arg);
......
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
static u32 hpet_ntimer, hpet_nhpet, hpet_max_freq = HPET_USER_FREQ; static u32 hpet_ntimer, hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
/* A lock for concurrent access by app and isr hpet activity. */ /* A lock for concurrent access by app and isr hpet activity. */
static spinlock_t hpet_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(hpet_lock);
/* A lock for concurrent intermodule access to hpet and isr hpet activity. */ /* A lock for concurrent intermodule access to hpet and isr hpet activity. */
static spinlock_t hpet_task_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(hpet_task_lock);
#define HPET_DEV_NAME (7) #define HPET_DEV_NAME (7)
......
...@@ -94,7 +94,7 @@ static struct list_head hvc_structs = LIST_HEAD_INIT(hvc_structs); ...@@ -94,7 +94,7 @@ static struct list_head hvc_structs = LIST_HEAD_INIT(hvc_structs);
* Protect the list of hvc_struct instances from inserts and removals during * Protect the list of hvc_struct instances from inserts and removals during
* list traversal. * list traversal.
*/ */
static spinlock_t hvc_structs_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(hvc_structs_lock);
/* /*
* Initial console vtermnos for console API usage prior to full console * Initial console vtermnos for console API usage prior to full console
......
...@@ -257,7 +257,7 @@ static struct task_struct *hvcs_task; ...@@ -257,7 +257,7 @@ static struct task_struct *hvcs_task;
static unsigned long *hvcs_pi_buff; static unsigned long *hvcs_pi_buff;
/* Only allow one hvcs_struct to use the hvcs_pi_buff at a time. */ /* Only allow one hvcs_struct to use the hvcs_pi_buff at a time. */
static spinlock_t hvcs_pi_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(hvcs_pi_lock);
/* One vty-server per hvcs_struct */ /* One vty-server per hvcs_struct */
struct hvcs_struct { struct hvcs_struct {
...@@ -308,7 +308,7 @@ struct hvcs_struct { ...@@ -308,7 +308,7 @@ struct hvcs_struct {
#define from_kobj(kobj) container_of(kobj, struct hvcs_struct, kobj) #define from_kobj(kobj) container_of(kobj, struct hvcs_struct, kobj)
static struct list_head hvcs_structs = LIST_HEAD_INIT(hvcs_structs); static struct list_head hvcs_structs = LIST_HEAD_INIT(hvcs_structs);
static spinlock_t hvcs_structs_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(hvcs_structs_lock);
static void hvcs_unthrottle(struct tty_struct *tty); static void hvcs_unthrottle(struct tty_struct *tty);
static void hvcs_throttle(struct tty_struct *tty); static void hvcs_throttle(struct tty_struct *tty);
......
...@@ -482,7 +482,7 @@ static int rng_dev_open (struct inode *inode, struct file *filp) ...@@ -482,7 +482,7 @@ static int rng_dev_open (struct inode *inode, struct file *filp)
static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size, static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
loff_t * offp) loff_t * offp)
{ {
static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(rng_lock);
unsigned int have_data; unsigned int have_data;
u32 data = 0; u32 data = 0;
ssize_t ret = 0; ssize_t ret = 0;
......
...@@ -304,7 +304,7 @@ static DECLARE_RWSEM(interfaces_sem); ...@@ -304,7 +304,7 @@ static DECLARE_RWSEM(interfaces_sem);
/* Directly protects the ipmi_interfaces data structure. This is /* Directly protects the ipmi_interfaces data structure. This is
claimed in the timer interrupt. */ claimed in the timer interrupt. */
static spinlock_t interfaces_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(interfaces_lock);
/* List of watchers that want to know when smi's are added and /* List of watchers that want to know when smi's are added and
deleted. */ deleted. */
......
...@@ -157,7 +157,7 @@ static char preaction[16] = "pre_none"; ...@@ -157,7 +157,7 @@ static char preaction[16] = "pre_none";
static unsigned char preop_val = WDOG_PREOP_NONE; static unsigned char preop_val = WDOG_PREOP_NONE;
static char preop[16] = "preop_none"; static char preop[16] = "preop_none";
static spinlock_t ipmi_read_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(ipmi_read_lock);
static char data_to_read = 0; static char data_to_read = 0;
static DECLARE_WAIT_QUEUE_HEAD(read_q); static DECLARE_WAIT_QUEUE_HEAD(read_q);
static struct fasync_struct *fasync_q = NULL; static struct fasync_struct *fasync_q = NULL;
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#include "mwavedd.h" #include "mwavedd.h"
#include "3780i.h" #include "3780i.h"
static spinlock_t dsp_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(dsp_lock);
static unsigned long flags; static unsigned long flags;
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
static spinlock_t nvram_state_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(nvram_state_lock);
static int nvram_open_cnt; /* #times opened */ static int nvram_open_cnt; /* #times opened */
static int nvram_open_mode; /* special open modes */ static int nvram_open_mode; /* special open modes */
#define NVRAM_WRITE 1 /* opened for writing (exclusive) */ #define NVRAM_WRITE 1 /* opened for writing (exclusive) */
......
...@@ -350,7 +350,7 @@ static int handle_data(unsigned char *p_data) ...@@ -350,7 +350,7 @@ static int handle_data(unsigned char *p_data)
} }
spinlock_t kbd_controller_lock = SPIN_LOCK_UNLOCKED; DEFINE_SPINLOCK(kbd_controller_lock);
static unsigned char handle_kbd_event(void); static unsigned char handle_kbd_event(void);
......
...@@ -683,7 +683,7 @@ struct sample { ...@@ -683,7 +683,7 @@ struct sample {
static struct sample *batch_entropy_pool, *batch_entropy_copy; static struct sample *batch_entropy_pool, *batch_entropy_copy;
static int batch_head, batch_tail; static int batch_head, batch_tail;
static spinlock_t batch_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(batch_lock);
static int batch_max; static int batch_max;
static void batch_entropy_process(void *private_); static void batch_entropy_process(void *private_);
......
...@@ -177,7 +177,7 @@ static unsigned long rtc_max_user_freq = 64; /* > this, need CAP_SYS_RESOURCE */ ...@@ -177,7 +177,7 @@ static unsigned long rtc_max_user_freq = 64; /* > this, need CAP_SYS_RESOURCE */
/* /*
* rtc_task_lock nests inside rtc_lock. * rtc_task_lock nests inside rtc_lock.
*/ */
static spinlock_t rtc_task_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(rtc_task_lock);
static rtc_task_t *rtc_callback = NULL; static rtc_task_t *rtc_callback = NULL;
#endif #endif
......
...@@ -229,7 +229,7 @@ static struct sysrq_key_op sysrq_unrt_op = { ...@@ -229,7 +229,7 @@ static struct sysrq_key_op sysrq_unrt_op = {
}; };
/* Key Operations table and lock */ /* Key Operations table and lock */
static spinlock_t sysrq_key_table_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(sysrq_key_table_lock);
#define SYSRQ_KEY_TABLE_LENGTH 36 #define SYSRQ_KEY_TABLE_LENGTH 36
static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = { static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = {
/* 0 */ &sysrq_loglevel_op, /* 0 */ &sysrq_loglevel_op,
......
...@@ -249,7 +249,7 @@ static void tty_set_termios_ldisc(struct tty_struct *tty, int num) ...@@ -249,7 +249,7 @@ static void tty_set_termios_ldisc(struct tty_struct *tty, int num)
* callers who will do ldisc lookups and cannot sleep. * callers who will do ldisc lookups and cannot sleep.
*/ */
static spinlock_t tty_ldisc_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(tty_ldisc_lock);
static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait); static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait);
static struct tty_ldisc tty_ldiscs[NR_LDISCS]; /* line disc dispatch table */ static struct tty_ldisc tty_ldiscs[NR_LDISCS]; /* line disc dispatch table */
...@@ -690,7 +690,7 @@ static struct file_operations hung_up_tty_fops = { ...@@ -690,7 +690,7 @@ static struct file_operations hung_up_tty_fops = {
.release = tty_release, .release = tty_release,
}; };
static spinlock_t redirect_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(redirect_lock);
static struct file *redirect; static struct file *redirect;
/** /**
......
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
#define VIOCONS_KERN_WARN KERN_WARNING "viocons: " #define VIOCONS_KERN_WARN KERN_WARNING "viocons: "
#define VIOCONS_KERN_INFO KERN_INFO "viocons: " #define VIOCONS_KERN_INFO KERN_INFO "viocons: "
static spinlock_t consolelock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(consolelock);
static spinlock_t consoleloglock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(consoleloglock);
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
static int vio_sysrq_pressed; static int vio_sysrq_pressed;
......
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