scsi: fc: remove redundant check of an unsigned long being less than zero
authorColin Ian King <colin.king@canonical.com>
Fri, 14 Apr 2017 13:58:02 +0000 (14:58 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 19 Apr 2017 01:52:09 +0000 (21:52 -0400)
The check for an unsigned long being less than zero is always false so
it is a redundant check and can be removed.

Detected by static analysis with by PVS-Studio

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_fc.c

index 2d753c93e07a28e1f49d2e1144a8bb1af00d406b..87b8f9d64d9bc91de2c5c15cf6cdc36b4987065b 100644 (file)
@@ -850,7 +850,7 @@ static int fc_str_to_dev_loss(const char *buf, unsigned long *val)
        char *cp;
 
        *val = simple_strtoul(buf, &cp, 0);
-       if ((*cp && (*cp != '\n')) || (*val < 0))
+       if (*cp && (*cp != '\n'))
                return -EINVAL;
        /*
         * Check for overflow; dev_loss_tmo is u32