scsi: ufs: don't check unsigned type for a negative value
authorTomas Winkler <tomas.winkler@intel.com>
Sun, 12 Mar 2017 10:22:02 +0000 (12:22 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 15 Mar 2017 17:37:18 +0000 (13:37 -0400)
Fix compilation warning:

drivers/scsi/ufs/ufshcd.c:7645:13: warning: comparison of unsigned
expression < 0 is always false [-Wtype-limits]
if ((value < UFS_PM_LVL_0) || (value >= UFS_PM_LVL_MAX))

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index 1359913bf840ce0522e09fe72b5c93bd210e4db7..e8c26e6e623726fe15f8e40ddafa089d68869c33 100644 (file)
@@ -7642,7 +7642,7 @@ static inline ssize_t ufshcd_pm_lvl_store(struct device *dev,
        if (kstrtoul(buf, 0, &value))
                return -EINVAL;
 
-       if ((value < UFS_PM_LVL_0) || (value >= UFS_PM_LVL_MAX))
+       if (value >= UFS_PM_LVL_MAX)
                return -EINVAL;
 
        spin_lock_irqsave(hba->host->host_lock, flags);