Re: [RFC] Patch to option HSO driver to the kernel

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oliver Neukum
Date: Tuesday, April 15, 2008 - 6:55 am

Am Montag, 14. April 2008 23:32:39 schrieb Greg KH:

This patch removes a creative abuse of in_interrupt(). Locking
is always done with a mutex now. No need for atomic operations.

Signed-off-by: Oliver Neukum <oneukum@suse.de>

---

--- linux-2.6.25-rc7-work/drivers/net/usb/hso.c.alt2	2008-04-15 15:21:25.000000000 +0200
+++ linux-2.6.25-rc7-work/drivers/net/usb/hso.c	2008-04-15 15:29:17.000000000 +0200
@@ -2201,21 +2201,13 @@ static int hso_stop_serial_device(struct
 		return -ENODEV;
 
 	for (i = 0; i < serial->num_rx_urbs; i++) {
-		if (serial->rx_urb[i]
-		    && (serial->rx_urb[i]->status == -EINPROGRESS)) {
-			if (in_interrupt())
-				usb_unlink_urb(serial->rx_urb[i]);
-			else
+		if (serial->rx_urb[i])
 				usb_kill_urb(serial->rx_urb[i]);
-		}
 	}
 
-	if (serial->tx_urb && (serial->tx_urb->status == -EINPROGRESS)) {
-		if (in_interrupt())
-			usb_unlink_urb(serial->tx_urb);
-		else
-			usb_kill_urb(serial->rx_urb[i]);
-	}
+	if (serial->tx_urb)
+		usb_kill_urb(serial->rx_urb[i]);
+
 	if (serial->shared_int) {
 		spin_lock_bh(&serial->shared_int->shared_int_lock);
 		if (serial->shared_int->use_count &&
@@ -2223,12 +2215,8 @@ static int hso_stop_serial_device(struct
 			struct urb *urb;
 
 			urb = serial->shared_int->shared_intr_urb;
-			if ((urb) && (urb->status == -EINPROGRESS)) {
-				if (in_interrupt())
-					usb_unlink_urb(urb);
-				else
-					usb_kill_urb(urb);
-			}
+			if (urb)
+				usb_kill_urb(urb);
 		}
 		spin_unlock_bh(&serial->shared_int->shared_int_lock);
 	}

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] Patch to option HSO driver to the kernel, Greg KH, (Mon Apr 14, 2:32 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Matthew Dharm, (Mon Apr 14, 2:59 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Andrew Bird (Sphere ..., (Mon Apr 14, 3:42 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Mon Apr 14, 4:20 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Hartkopp, (Mon Apr 14, 9:30 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Filip Aben, (Tue Apr 15, 1:01 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 1:10 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Tue Apr 15, 1:58 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 4:44 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 6:06 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 6:25 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 6:55 am)
Re: [RFC] Patch to option HSO driver to the kernel, Filip Aben, (Tue Apr 15, 7:12 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 7:14 am)
Re: [RFC] Patch to option HSO driver to the kernel, Filip Aben, (Tue Apr 15, 8:03 am)
Re: [RFC] Patch to option HSO driver to the kernel, Filip Aben, (Tue Apr 15, 9:24 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Hartkopp, (Tue Apr 15, 10:53 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 10:58 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 11:46 am)
Re: [RFC] Patch to option HSO driver to the kernel, Stephen Hemminger, (Tue Apr 15, 12:14 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Tue Apr 15, 1:17 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Tue Apr 15, 3:49 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Wed Apr 16, 2:18 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Wed Apr 16, 4:54 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Wed Apr 16, 5:03 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Wed Apr 16, 5:12 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Wed Apr 16, 6:11 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Wed Apr 16, 6:43 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Wed Apr 16, 6:55 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Wed Apr 16, 8:15 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Thu Apr 17, 5:15 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Thu Apr 17, 7:32 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Thu Apr 17, 2:47 pm)
RE: Re: [RFC] Patch to option HSO driver to the kernel, Chetty, Jay, (Thu Apr 17, 3:31 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Thu Apr 17, 11:51 pm)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Fri Apr 18, 8:18 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Mon Apr 21, 4:45 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Mon Apr 21, 5:38 am)
Re: [RFC] Patch to option HSO driver to the kernel, Oliver Neukum, (Mon Apr 21, 5:50 am)
Re: [RFC] Patch to option HSO driver to the kernel, Paulius Zaleckas, (Mon Apr 21, 6:00 am)