Skip to content

Commit

Permalink
scsi: fc: remove redundant check of an unsigned long being less than …
Browse files Browse the repository at this point in the history
…zero

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>
  • Loading branch information
Colin Ian King authored and Martin K. Petersen committed Apr 19, 2017
1 parent 5c66d93 commit eea4227
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eea4227

Please sign in to comment.