Skip to contentSkip to conversation

scsi_transport_fc: remove unneeded check

PATCH New Dan Carpenter 1 participant 1 message Jul 17, 2010

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

PATCH 1/1 scsi_transport_fc: remove unneeded check

"val" can never be less than zero here. It's unsigned and simple_strtoul() always returns positive values.

I also cleaned up the check. "*cp != '\0'" is more explicit than "*cp" and I removed some parenthesis that weren't needed.

drivers/scsi/scsi_transport_fc.c +1 -1
index 0681378..b108a9b 100644
@@ -844,7 +844,7 @@ store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr,
 	    (rport->port_state = FC_PORTSTATE_NOTPRESENT))
 		return -EBUSY;
 	val = simple_strtoul(buf, &cp, 0);
-	if ((*cp && (*cp != '\n')) || (val < 0))
+	if (*cp != '\0' && *cp != '\n')
 		return -EINVAL;
 
 	/*