public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] IA64: only call up() in salinfo_work_to_do() if down_trylock() was successful
@ 2008-07-29  9:47 Simon Horman
  2008-07-29 12:47 ` Keith Owens
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Horman @ 2008-07-29  9:47 UTC (permalink / raw)
  To: linux-ia64, linux-kernel; +Cc: Tony Luck

Aesthetic issues aside is it safe to call up() if down_trylock() failed?

arch/ia64/kernel/salinfo.c: In function `salinfo_work_to_do':
arch/ia64/kernel/salinfo.c:195: warning: ignoring return value of `down_trylock'

Signed-off-by: Simon Horman <horms@verge.net.au>

Index: linux-2.6/arch/ia64/kernel/salinfo.c
===================================================================
--- linux-2.6.orig/arch/ia64/kernel/salinfo.c	2008-07-29 19:06:33.000000000 +1000
+++ linux-2.6/arch/ia64/kernel/salinfo.c	2008-07-29 19:40:02.000000000 +1000
@@ -192,8 +192,8 @@ struct salinfo_platform_oemdata_parms {
 static void
 salinfo_work_to_do(struct salinfo_data *data)
 {
-	down_trylock(&data->mutex);
-	up(&data->mutex);
+	if (down_trylock(&data->mutex) == 0)
+		up(&data->mutex);
 }
 
 static void

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-30 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-29  9:47 [patch] IA64: only call up() in salinfo_work_to_do() if down_trylock() was successful Simon Horman
2008-07-29 12:47 ` Keith Owens
2008-07-29 13:07   ` Simon Horman
2008-07-30  9:43     ` Andrew Morton
2008-07-30 16:12       ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox