mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Changli Gao <xiaosuo@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Andreas Herrmann <andreas.herrmann3@amd.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mike Galbraith <efault@gmx.de>,
	linux-kernel@vger.kernel.org, Changli Gao <xiaosuo@gmail.com>
Subject: [PATCH] sched: use wrapper functions
Date: Wed, 28 Apr 2010 11:43:08 +0800	[thread overview]
Message-ID: <1272426188-2982-1-git-send-email-xiaosuo@gmail.com> (raw)

use wrapper functions.

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

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
 kernel/sched.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 6af210a..be5ab70 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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;
 	}

                 reply	other threads:[~2010-04-28  4:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272426188-2982-1-git-send-email-xiaosuo@gmail.com \
    --to=xiaosuo@gmail.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome