From mboxrd@z Thu Jan 1 00:00:00 1970 From: Domen Puncer Date: Sat, 20 Mar 2004 21:33:36 +0000 Subject: [Kernel-janitors] [patch 2.6.4] removing sleep_on in Message-Id: <200403202233.37294.domen@coderock.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel-janitors@vger.kernel.org Hi. This is my first patch on sleep_on, so i'd really like some comments. 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