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 2d753c9..87b8f9d 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