Skip to contentSkip to conversation

sched: use wrapper functions

PATCH New Changli Gao 1 participant 1 message Apr 28, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: use wrapper functions

use wrapper functions.

Since there are add_wait_queue_exclusive_locked() and remove_wait_queue_locked() , we'd better use them instead.

----

 kernel/sched.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/sched.c +2 -3
index 6af210a..be5ab70 100644
@@ -4039,8 +4039,7 @@ do_wait_for_common(struct completion *x, long timeout, int state)
 	if (!x->done) {
 		DECLARE_WAITQUEUE(wait, current);
 
-		wait.flags |= WQ_FLAG_EXCLUSIVE;
-		__add_wait_queue_tail(&x->wait, &wait);
+		add_wait_queue_exclusive_locked(&x->wait, &wait);
 		do {
 			if (signal_pending_state(state, current)) {
 				timeout = -ERESTARTSYS;
@@ -4051,7 +4050,7 @@ do_wait_for_common(struct completion *x, long timeout, int state)
 			timeout = schedule_timeout(timeout);
 			spin_lock_irq(&x->wait.lock);
 		} while (!x->done && timeout);
-		__remove_wait_queue(&x->wait, &wait);
+		remove_wait_queue_locked(&x->wait, &wait);
 		if (!x->done)
 			return timeout;
 	}