[patch] [SCSI] libfcoe: remove and unneeded check

DORMANTno replies

From: Dan Carpenter <hidden>
Date: 2012-06-07 08:23:53
Also in: kernel-janitors
Subsystem: fcoe subsystem (libfc, libfcoe, fcoe), scsi subsystem, the rest · Maintainers: Hannes Reinecke, "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

Unsigned values are never less than zero.  We check for an upper bound
later so that's OK too.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 2bc1631..6e402f6 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -102,8 +102,8 @@ static int fcoe_str_to_dev_loss(const char *buf, unsigned long *val)
 	int ret;
 
 	ret = kstrtoul(buf, 0, val);
-	if (ret || *val < 0)
-		return -EINVAL;
+	if (ret)
+		return ret;
 	/*
 	 * Check for overflow; dev_loss_tmo is u32
 	 */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help