From f3593b77a6ab8550c119e0617e3dee4abf144533 Mon Sep 17 00:00:00 2001
From: Marin Ramesa <mpr@hi.t-com.hr>
Date: Mon, 16 Dec 2013 00:18:41 +0100
Subject: kern: quiet GCC warnings about set but unused variables

* kern/lock.h (simple_lock_data_empty): Define.
(decl_simple_lock_data, simple_unlock): Likewise.
* kern/sched_prim.c (lock): Declare.
[MACH_SLOCKS]: Remove #ifs.
* kern/task.c (task_lock, task_unlock): Remove address operator.
---
 kern/sched_prim.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

(limited to 'kern/sched_prim.c')

diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index ec041fc8..8aad1462 100644
--- a/kern/sched_prim.c
+++ b/kern/sched_prim.c
@@ -226,9 +226,7 @@ void assert_wait(
 	queue_t			q;
 	int			index;
 	thread_t		thread;
-#if	MACH_SLOCKS
-	simple_lock_t		lock;
-#endif	/* MACH_SLOCKS */
+	decl_simple_lock_data( , *lock);
 	spl_t			s;
 
 	thread = current_thread();
@@ -240,9 +238,7 @@ void assert_wait(
 	if (event != 0) {
 		index = wait_hash(event);
 		q = &wait_queue[index];
-#if	MACH_SLOCKS
 		lock = &wait_lock[index];
-#endif	/* MACH_SLOCKS */
 		simple_lock(lock);
 		thread_lock(thread);
 		enqueue_tail(q, &(thread->links));
@@ -284,9 +280,7 @@ void clear_wait(
 {
 	int			index;
 	queue_t			q;
-#if	MACH_SLOCKS
-	simple_lock_t		lock;
-#endif	/* MACH_SLOCKS */
+	decl_simple_lock_data( , *lock);
 	event_t			event;
 	spl_t			s;
 
@@ -306,9 +300,7 @@ void clear_wait(
 		thread_unlock(thread);
 		index = wait_hash(event);
 		q = &wait_queue[index];
-#if	MACH_SLOCKS
 		lock = &wait_lock[index];
-#endif	/* MACH_SLOCKS */
 		simple_lock(lock);
 		/*
 		 *	If the thread is still waiting on that event,
@@ -387,18 +379,14 @@ void thread_wakeup_prim(
 	queue_t			q;
 	int			index;
 	thread_t		thread, next_th;
-#if	MACH_SLOCKS
-	simple_lock_t		lock;
-#endif  /* MACH_SLOCKS */
+	decl_simple_lock_data( , *lock);
 	spl_t			s;
 	int			state;
 
 	index = wait_hash(event);
 	q = &wait_queue[index];
 	s = splsched();
-#if	MACH_SLOCKS
 	lock = &wait_lock[index];
-#endif	/* MACH_SLOCKS */
 	simple_lock(lock);
 	thread = (thread_t) queue_first(q);
 	while (!queue_end(q, (queue_entry_t)thread)) {
-- 
cgit v1.2.3