linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] scsi_transport_fc: remove unneeded check
@ 2010-07-17 18:27 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-07-17 18:27 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: James Smart, Christof Schmitt, Hannes Reinecke, Mike Christie,
	linux-scsi, kernel-janitors

"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.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 0681378..b108a9b 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -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;
 
 	/*

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

only message in thread, other threads:[~2010-07-17 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-17 18:27 [patch] scsi_transport_fc: remove unneeded check Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).