From: Daniel Walker Date: Fri, 11 Jan 2008 04:31:51 +0000 (-0800) Subject: [IA64] sn_hwperf semaphore to mutex X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0245583ab454ba56131921e26ad966b56bcc0a5b;p=linux-beck.git [IA64] sn_hwperf semaphore to mutex 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 Signed-off-by: Tony Luck --- diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index ca882744d753..4b0d1538e7e5 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -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; }