* [PATCH] ia64: sn_hwperf semaphore to mutex
@ 2008-01-11 4:31 Daniel Walker
0 siblings, 0 replies; only message in thread
From: Daniel Walker @ 2008-01-11 4:31 UTC (permalink / raw)
To: linux-ia64
Really simple mutex style semaphore user. The new API is struct mutex which is
what I've converted it to with this change.
Signed-off-by: Daniel Walker <dwalker@mvista.com>
---
arch/ia64/sn/kernel/sn2/sn_hwperf.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Index: linux-2.6.23/arch/ia64/sn/kernel/sn2/sn_hwperf.c
=================================--- linux-2.6.23.orig/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ linux-2.6.23/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -33,6 +33,7 @@
#include <linux/smp_lock.h>
#include <linux/nodemask.h>
#include <linux/smp.h>
+#include <linux/mutex.h>
#include <asm/processor.h>
#include <asm/topology.h>
@@ -50,7 +51,7 @@ static void *sn_hwperf_salheap = NULL;
static int sn_hwperf_obj_cnt = 0;
static nasid_t sn_hwperf_master_nasid = INVALID_NASID;
static int sn_hwperf_init(void);
-static DECLARE_MUTEX(sn_hwperf_init_mutex);
+static DEFINE_MUTEX(sn_hwperf_init_mutex);
#define cnode_possible(n) ((n) < num_cnodes)
@@ -884,10 +885,10 @@ static int sn_hwperf_init(void)
int e = 0;
/* single threaded, once-only initialization */
- down(&sn_hwperf_init_mutex);
+ mutex_lock(&sn_hwperf_init_mutex);
if (sn_hwperf_salheap) {
- up(&sn_hwperf_init_mutex);
+ mutex_unlock(&sn_hwperf_init_mutex);
return e;
}
@@ -936,7 +937,7 @@ out:
sn_hwperf_salheap = NULL;
sn_hwperf_obj_cnt = 0;
}
- up(&sn_hwperf_init_mutex);
+ mutex_unlock(&sn_hwperf_init_mutex);
return e;
}
--
--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-11 4:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11 4:31 [PATCH] ia64: sn_hwperf semaphore to mutex Daniel Walker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox