mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[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 <[email protected]> Cc: Dave Jones <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Neil Brown <[email protected]> Acked-by: Alasdair G Kergon <[email protected]> Cc: Greg KH <[email protected]> Cc: Dominik Brodowski <[email protected]> Cc: Adam Belay <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
353ab6e97b
commit
14cc3e2b63
20 changed files with 172 additions and 157 deletions
|
|
@ -34,7 +34,7 @@
|
|||
#include <asm/system.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <asm/semaphore.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#include "ptrace.h"
|
||||
|
||||
|
|
@ -207,19 +207,19 @@ void die_if_kernel(const char *str, struct pt_regs *regs, int err)
|
|||
die(str, regs, err);
|
||||
}
|
||||
|
||||
static DECLARE_MUTEX(undef_sem);
|
||||
static DEFINE_MUTEX(undef_mutex);
|
||||
static int (*undef_hook)(struct pt_regs *);
|
||||
|
||||
int request_undef_hook(int (*fn)(struct pt_regs *))
|
||||
{
|
||||
int ret = -EBUSY;
|
||||
|
||||
down(&undef_sem);
|
||||
mutex_lock(&undef_mutex);
|
||||
if (undef_hook == NULL) {
|
||||
undef_hook = fn;
|
||||
ret = 0;
|
||||
}
|
||||
up(&undef_sem);
|
||||
mutex_unlock(&undef_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -228,12 +228,12 @@ int release_undef_hook(int (*fn)(struct pt_regs *))
|
|||
{
|
||||
int ret = -EINVAL;
|
||||
|
||||
down(&undef_sem);
|
||||
mutex_lock(&undef_mutex);
|
||||
if (undef_hook == fn) {
|
||||
undef_hook = NULL;
|
||||
ret = 0;
|
||||
}
|
||||
up(&undef_sem);
|
||||
mutex_unlock(&undef_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue