summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2012-07-06 10:40:20 -0700
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 08:58:55 +0100
commit902a45af5c9fad283a530c3bc71225fa6a8e616a (patch)
tree6c3787d210415a547e274476c1af37f3efb1c229 /drivers/scsi
parentb29a4f309fb58165ebfcca0fba504ae90ec4cfa6 (diff)
downloadop-kernel-dev-902a45af5c9fad283a530c3bc71225fa6a8e616a.zip
op-kernel-dev-902a45af5c9fad283a530c3bc71225fa6a8e616a.tar.gz
[SCSI] fcoe: Remove redundant 'less than zero' check
strtoul returns an 'unsigned long' so there is no reason to check if the value is less than zero. strtoul already checks for the '-' character deep in its bowels. It will return an error if the user has provided a negative value and fcoe_str_to_dev_loss will return that error to its caller. This patch fixes the following Coverity reported warning: CID 703581 - NO_EFFECT Unsigned compared against 0 - This less-than-zero comparison of an unsigned value is never true. "*val < 0UL". drivers/scsi/fcoe/fcoe_sysfs.c:105 Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/fcoe/fcoe_sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 2bc1631..5e75168 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -102,7 +102,7 @@ static int fcoe_str_to_dev_loss(const char *buf, unsigned long *val)
int ret;
ret = kstrtoul(buf, 0, val);
- if (ret || *val < 0)
+ if (ret)
return -EINVAL;
/*
* Check for overflow; dev_loss_tmo is u32
OpenPOWER on IntegriCloud