Skip to contentSkip to conversation

USB: wwan: remove an unneeded check

PATCH New Dan Carpenter 1 participant 1 message Apr 20, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: wwan: remove an unneeded check

We already verified that "status" was zero on this else branch. Since zero is not equal to -ESHUTDOWN, this condition is always true. I removed it and pull everything in an indent level.

This doesn't change how the code works, it's just a cleanup.

---
It could also be that it's supposed to be checking something else. I read through the history but status has always been zero here.

drivers/usb/serial/usb_wwan.c +8 -11
index c88657d..a38b980 100644
@@ -307,20 +307,17 @@ static void usb_wwan_indat_callback(struct urb *urb)
 		}
 
 		/* Resubmit urb so we continue receiving */
-		if (status != -ESHUTDOWN) {
-			err = usb_submit_urb(urb, GFP_ATOMIC);
-			if (err) {
-				if (err != -EPERM) {
-					printk(KERN_ERR "%s: resubmit read urb failed. "
-						"(%d)", __func__, err);
-					/* busy also in error unless we are killed */
-					usb_mark_last_busy(port->serial->dev);
-				}
-			} else {
+		err = usb_submit_urb(urb, GFP_ATOMIC);
+		if (err) {
+			if (err != -EPERM) {
+				printk(KERN_ERR "%s: resubmit read urb failed. "
+					"(%d)", __func__, err);
+				/* busy also in error unless we are killed */
 				usb_mark_last_busy(port->serial->dev);
 			}
+		} else {
+			usb_mark_last_busy(port->serial->dev);
 		}
-
 	}
 }