[PATCH]: mutex: Fix !CONFIG_MUTEX_SPIN_ON_OWNER compile warning

Prarit Bhargava
2010-05-27T19:07:56Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

Fixes linux-next !CONFIG_MUTEX_SPIN_ON_OWNER compile warning:

kernel/mutex.c: In function ‘__mutex_lock_common’:
kernel/mutex.c:148: error: unused variable ‘timeout’

timeout is only used if CONFIG_MUTEX_SPIN_ON_OWNER is on.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>

diff --git a/kernel/mutex.c b/kernel/mutex.c
index 7d4626b..c262942 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -145,7 +145,9 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
struct task_struct *task = current;
struct mutex_waiter waiter;
unsigned long flags;
+#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
unsigned long timeout;
+#endif

preempt_disable();
mutex_acquire(&lock->dep_map, subclass, 0, ip);