All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [UPDATE PATCH] ieee1394/video1394: replace
@ 2005-03-03 23:22 Nishanth Aravamudan
  0 siblings, 0 replies; only message in thread
From: Nishanth Aravamudan @ 2005-03-03 23:22 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 2326 bytes --]

On Thu, Mar 03, 2005 at 05:07:52PM -0500, Jody McIntyre wrote:
> On Tue, Feb 22, 2005 at 09:37:33AM -0800, Nishanth Aravamudan wrote:
> > On Tue, Feb 22, 2005 at 12:29:02PM -0500, Jody McIntyre wrote:
> > > Please add a Signed-off-by: line.
> > 
> > Will do, I just wanted to get you a patch to test first. If it works,
> > I'll send an "official" one :)
> 
> It's been over a week and nobody's reported any problems with your
> patch.  Please send an "official" one and I will apply it.

Description: Use wait_event_interruptible() instead of the deprecated
interruptible_sleep_on(). Add a helper function to make the condition
for wait_event_interruptible() sane and lock-safe. Patch is compile-tested.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>


--- 2.6.11-v/drivers/ieee1394/video1394.c	2005-03-01 23:37:49.000000000 -0800
+++ 2.6.11/drivers/ieee1394/video1394.c	2005-03-03 15:22:01.000000000 -0800
@@ -699,6 +699,17 @@ static void initialize_dma_it_ctx(struct
 	reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1<<d->ctx);
 }
 
+static inline unsigned video1394_buffer_state(struct dma_iso_ctx *d,
+					      unsigned int buffer)
+{
+	unsigned long flags;
+	unsigned int ret;
+	spin_lock_irqsave(&d->lock, flags);
+	ret = d->buffer_status[buffer];
+	spin_unlock_irqrestore(&d->lock, flags);
+	return ret;
+}
+
 static int __video1394_ioctl(struct file *file,
 			     unsigned int cmd, unsigned long arg)
 {
@@ -952,24 +963,12 @@ static int __video1394_ioctl(struct file
 			    return -EINTR;
 			}
 
-#if 1
-			while (d->buffer_status[v.buffer]!=
-			      VIDEO1394_BUFFER_READY) {
-				spin_unlock_irqrestore(&d->lock, flags);
-				interruptible_sleep_on(&d->waitq);
-				spin_lock_irqsave(&d->lock, flags);
-				if (signal_pending(current)) {
-					spin_unlock_irqrestore(&d->lock,flags);
-					return -EINTR;
-				}
-			}
-#else
-			if (wait_event_interruptible(d->waitq,
-						     d->buffer_status[v.buffer]
-						     == VIDEO1394_BUFFER_READY)
-			    == -ERESTARTSYS)
+			spin_unlock_irqrestore(&d->lock, flags);
+			wait_event_interruptible(d->waitq,
+					video1394_buffer_state(d, v.buffer) == VIDEO1394_BUFFER_READY);
+			if (signal_pending(current))
 				return -EINTR;
-#endif
+			spin_lock_irqsave(&d->lock, flags);
 			d->buffer_status[v.buffer]=VIDEO1394_BUFFER_FREE;
 			break;
 		default:

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-03 23:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-03 23:22 [KJ] [UPDATE PATCH] ieee1394/video1394: replace Nishanth Aravamudan

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.