Skip to content

Commit

Permalink
uml: mconsole mutex conversion
Browse files Browse the repository at this point in the history
The plug_mem_mutex is already used as a mutex since it's using
DECLARE_MUTEX(), but the underlying construct is still a semaphore ..  This
patch switches it over to a struct mutex.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Daniel Walker authored and Linus Torvalds committed Feb 5, 2008
1 parent 01ac835 commit e98fa28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/um/drivers/mconsole_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "linux/syscalls.h"
#include "linux/utsname.h"
#include "linux/workqueue.h"
#include "linux/mutex.h"
#include "asm/uaccess.h"
#include "init.h"
#include "irq_kern.h"
Expand Down Expand Up @@ -360,7 +361,7 @@ struct unplugged_pages {
void *pages[UNPLUGGED_PER_PAGE];
};

static DECLARE_MUTEX(plug_mem_mutex);
static DEFINE_MUTEX(plug_mem_mutex);
static unsigned long long unplugged_pages_count = 0;
static LIST_HEAD(unplugged_pages);
static int unplug_index = UNPLUGGED_PER_PAGE;
Expand Down Expand Up @@ -396,7 +397,7 @@ static int mem_config(char *str, char **error_out)

diff /= PAGE_SIZE;

down(&plug_mem_mutex);
mutex_lock(&plug_mem_mutex);
for (i = 0; i < diff; i++) {
struct unplugged_pages *unplugged;
void *addr;
Expand Down Expand Up @@ -453,7 +454,7 @@ static int mem_config(char *str, char **error_out)

err = 0;
out_unlock:
up(&plug_mem_mutex);
mutex_unlock(&plug_mem_mutex);
out:
return err;
}
Expand Down

0 comments on commit e98fa28

Please sign in to comment.