diff options
author | Daniel Walker <dwalker@mvista.com> | 2008-01-30 07:31:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:17 -0500 |
commit | 8c8b8859b64baf6d7c33900e8720c7bafe775b2c (patch) | |
tree | 9c43ff6b227678460dc115bf0c2e2774d905f9e1 /arch/x86/kernel/cpu/mcheck | |
parent | fa20efd2fcd9349770113c6f72fc76ce437b62f5 (diff) |
mcheck mce_64: mce_read_sem to mutex
Converted to a mutex, and changed the name to mce_read_mutex.
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_64.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index 0adad772d0da..8cd47fe2ef2c 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c | |||
@@ -564,7 +564,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, | |||
564 | loff_t *off) | 564 | loff_t *off) |
565 | { | 565 | { |
566 | unsigned long *cpu_tsc; | 566 | unsigned long *cpu_tsc; |
567 | static DECLARE_MUTEX(mce_read_sem); | 567 | static DEFINE_MUTEX(mce_read_mutex); |
568 | unsigned next; | 568 | unsigned next; |
569 | char __user *buf = ubuf; | 569 | char __user *buf = ubuf; |
570 | int i, err; | 570 | int i, err; |
@@ -573,12 +573,12 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, | |||
573 | if (!cpu_tsc) | 573 | if (!cpu_tsc) |
574 | return -ENOMEM; | 574 | return -ENOMEM; |
575 | 575 | ||
576 | down(&mce_read_sem); | 576 | mutex_lock(&mce_read_mutex); |
577 | next = rcu_dereference(mcelog.next); | 577 | next = rcu_dereference(mcelog.next); |
578 | 578 | ||
579 | /* Only supports full reads right now */ | 579 | /* Only supports full reads right now */ |
580 | if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) { | 580 | if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) { |
581 | up(&mce_read_sem); | 581 | mutex_unlock(&mce_read_mutex); |
582 | kfree(cpu_tsc); | 582 | kfree(cpu_tsc); |
583 | return -EINVAL; | 583 | return -EINVAL; |
584 | } | 584 | } |
@@ -621,7 +621,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, | |||
621 | memset(&mcelog.entry[i], 0, sizeof(struct mce)); | 621 | memset(&mcelog.entry[i], 0, sizeof(struct mce)); |
622 | } | 622 | } |
623 | } | 623 | } |
624 | up(&mce_read_sem); | 624 | mutex_unlock(&mce_read_mutex); |
625 | kfree(cpu_tsc); | 625 | kfree(cpu_tsc); |
626 | return err ? -EFAULT : buf - ubuf; | 626 | return err ? -EFAULT : buf - ubuf; |
627 | } | 627 | } |