All of lore.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <domen@coderock.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [Kernel-janitors] [patch 2.6.4] removing sleep_on in
Date: Sat, 20 Mar 2004 22:13:02 +0000	[thread overview]
Message-ID: <200403202313.02178.domen@coderock.org> (raw)
In-Reply-To: <200403202233.37294.domen@coderock.org>

On Saturday 20 of March 2004 22:48, Greg KH wrote:
> On Sat, Mar 20, 2004 at 10:33:36PM +0100, Domen Puncer wrote:
> > Hi.
> > 
> > This is my first patch on sleep_on, so i'd really like some comments.
> 
> Please cc the linux-usb-devel list, they will help you out too
> (hopefully...)

Comments and patch again, for the linux-usb-devel people...

Is wait_event(wq, 0) fine, if we are just waiting for wake_up?
Second one is just waiting 3 seconds, so i removed wq.

        Domen


--- c/drivers/usb/media/usbvideo.c	2003-12-18 03:59:59.000000000 +0100
+++ a/drivers/usb/media/usbvideo.c	2004-03-20 17:46:58.000000000 +0100
@@ -225,7 +225,7 @@
 static void RingQueue_InterruptibleSleepOn(struct RingQueue *rq)
 {
 	assert(rq != NULL);
-	interruptible_sleep_on(&rq->wqh);
+	wait_event_interruptible(&rq->wqh, 0);
 }
 
 void RingQueue_WakeUpInterruptible(struct RingQueue *rq)
@@ -705,10 +705,9 @@
 /* Debugging aid */
 void usbvideo_SayAndWait(const char *what)
 {
-	wait_queue_head_t wq;
-	init_waitqueue_head(&wq);
 	info("Say: %s", what);
-	interruptible_sleep_on_timeout (&wq, HZ*3); /* Timeout */
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(HZ*3);
 }
 
 EXPORT_SYMBOL(usbvideo_SayAndWait);
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2004-03-20 22:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-20 21:33 [Kernel-janitors] [patch 2.6.4] removing sleep_on in Domen Puncer
2004-03-20 21:48 ` Greg KH
2004-03-20 22:13 ` Domen Puncer [this message]
2004-03-21  0:06 ` Domen Puncer
2004-03-21  1:14 ` [Kernel-janitors] [patch 2.6.4] removing sleep_on from Domen Puncer

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=200403202313.02178.domen@coderock.org \
    --to=domen@coderock.org \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.