scsi: ufs: don't check unsigned type for a negative value
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))
--- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +1 -1
@@ -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);
Signature · 1 line
2.9.3
Subhash Jadavani
Reviewed-byQuoted 24 lines · Tomas Winkler
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 <[email protected]>--- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/ufs/ufshcd.c +1
-1@@ -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 ;
Quoted 1 line
spin_lock_irqsave(hba->host->host_lock, flags);
LGTM.
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Martin K. Petersen
AppliedQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Tomas" == Tomas Winkler <[email protected]> writes:
Tomas> Fix compilation warning drivers/scsi/ufs/ufshcd.c:7645:13:
Tomas> warning: comparison of unsigned expression < 0 is always false Tomas> [-Wtype-limits] if ((value < UFS_PM_LVL_0) || (value >= Tomas> UFS_PM_LVL_MAX))
Applied to 4.11/scsi-fixes, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
James Bottomley
maintainerQuoted 22 lines · Subhash Jadavani
Quoted 21 lines · Tomas Winkler
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 <[email protected]>--- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/ufs/ufshcd.c +0
-0@@ -7642,7 +7642,7 @@ static inline ssize_tufshcd_pm_lvl_store(struct
device *dev,drivers/scsi/ufs/ufshcd.c +0
-0if (kstrtoul (buf,0 , &value))return -EINVAL ;
Quoted 8 lines
drivers/scsi/ufs/ufshcd.c static inline ssize_t ufshcd_pm_lvl_store(struct device *dev, · line 7648
Quoted 5 lines
drivers/scsi/ufs/ufshcd.c +1
-1-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);LGTM.
Reviewed-by Subhash Jadavani <[email protected]>
Mis-spelling someone else's email can be cut and paste; mis-spelling your own might be the early indications of an identity crisis.
We do cut and paste these tags, so getting your own name right for the purposes of git history is useful.
James
Subhash Jadavani
Reviewed-byQuoted 32 lines · James Bottomley
Quoted 22 lines · Subhash Jadavani
Quoted 21 lines · Tomas Winkler
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 <[email protected]>--- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/ufs/ufshcd.c +0
-0@@ -7642,7 +7642,7 @@ static inline ssize_tufshcd_pm_lvl_store(struct
device *dev,drivers/scsi/ufs/ufshcd.c +0
-0if (kstrtoul (buf,0 , &value))return -EINVAL ;Quoted 8 lines
drivers/scsi/ufs/ufshcd.c static inline ssize_t ufshcd_pm_lvl_store(struct device *dev, · line 7648
Quoted 5 lines
drivers/scsi/ufs/ufshcd.c +1
-1-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);LGTM.
Reviewed-by Subhash Jadavani <[email protected]>
Quoted 7 lines
Mis-spelling someone else's email can be cut and paste; mis-spelling your own might be the early indications of an identity crisis.
We do cut and paste these tags, so getting your own name right for the purposes of git history is useful.
James
Oops, sorry for this. If you haven't already corrected this:
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project