From: Colin Ian King Date: Fri, 14 Apr 2017 13:58:02 +0000 (+0100) Subject: scsi: fc: remove redundant check of an unsigned long being less than zero X-Git-Tag: v4.14-rc1~995^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eea422709fd89aec27be408f451557ebedd19f11;p=platform%2Fkernel%2Flinux-rpi.git scsi: fc: remove redundant check of an unsigned long being less than 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 Reviewed-by: Tyrel Datwyler Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 2d753c9..87b8f9d 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -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