diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-26 04:37:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:56:55 -0500 |
commit | 14cc3e2b633bb64063698980974df4535368e98f (patch) | |
tree | d542c9db7376de199d640b8e34d5630460b217b5 /arch/i386/kernel/microcode.c | |
parent | 353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1 (diff) |
[PATCH] sem2mutex: misc static one-file mutexes
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Jens Axboe <axboe@suse.de>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Cc: Greg KH <greg@kroah.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/microcode.c')
-rw-r--r-- | arch/i386/kernel/microcode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index 55bc365b8753..dd780a00553f 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c | |||
@@ -81,6 +81,7 @@ | |||
81 | #include <linux/miscdevice.h> | 81 | #include <linux/miscdevice.h> |
82 | #include <linux/spinlock.h> | 82 | #include <linux/spinlock.h> |
83 | #include <linux/mm.h> | 83 | #include <linux/mm.h> |
84 | #include <linux/mutex.h> | ||
84 | 85 | ||
85 | #include <asm/msr.h> | 86 | #include <asm/msr.h> |
86 | #include <asm/uaccess.h> | 87 | #include <asm/uaccess.h> |
@@ -114,7 +115,7 @@ MODULE_LICENSE("GPL"); | |||
114 | static DEFINE_SPINLOCK(microcode_update_lock); | 115 | static DEFINE_SPINLOCK(microcode_update_lock); |
115 | 116 | ||
116 | /* no concurrent ->write()s are allowed on /dev/cpu/microcode */ | 117 | /* no concurrent ->write()s are allowed on /dev/cpu/microcode */ |
117 | static DECLARE_MUTEX(microcode_sem); | 118 | static DEFINE_MUTEX(microcode_mutex); |
118 | 119 | ||
119 | static void __user *user_buffer; /* user area microcode data buffer */ | 120 | static void __user *user_buffer; /* user area microcode data buffer */ |
120 | static unsigned int user_buffer_size; /* it's size */ | 121 | static unsigned int user_buffer_size; /* it's size */ |
@@ -444,7 +445,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_ | |||
444 | return -EINVAL; | 445 | return -EINVAL; |
445 | } | 446 | } |
446 | 447 | ||
447 | down(µcode_sem); | 448 | mutex_lock(µcode_mutex); |
448 | 449 | ||
449 | user_buffer = (void __user *) buf; | 450 | user_buffer = (void __user *) buf; |
450 | user_buffer_size = (int) len; | 451 | user_buffer_size = (int) len; |
@@ -453,7 +454,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_ | |||
453 | if (!ret) | 454 | if (!ret) |
454 | ret = (ssize_t)len; | 455 | ret = (ssize_t)len; |
455 | 456 | ||
456 | up(µcode_sem); | 457 | mutex_unlock(µcode_mutex); |
457 | 458 | ||
458 | return ret; | 459 | return ret; |
459 | } | 460 | } |