From: Subhash Jadavani <subhashj@codeaurora.org>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Vinayak Holikatti <vinholikatti@gmail.com>,
Christoph Hellwig <hch@lst.de>,
Yaniv Gardi <ygardi@codeaurora.org>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [scsi] scsi: ufs: don't check unsigned type for a negative value
Date: Mon, 13 Mar 2017 17:19:01 -0700 [thread overview]
Message-ID: <cf0e9b50910b10166d23cb37e9f5b4b0@codeaurora.org> (raw)
In-Reply-To: <20170312102202.9889-1-tomas.winkler@intel.com>
On 2017-03-12 03:22, Tomas Winkler wrote:
> 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>
> ---
> drivers/scsi/ufs/ufshcd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 1359913bf840..e8c26e6e6237 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -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);
LGTM.
Reviewed-by: Subhash Jadavani <subhashj@codaurora.org>
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-03-14 0:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-12 10:22 [scsi] scsi: ufs: don't check unsigned type for a negative value Tomas Winkler
2017-03-14 0:19 ` Subhash Jadavani [this message]
2017-03-15 17:26 ` James Bottomley
2017-03-15 22:57 ` Subhash Jadavani
2017-03-14 3:02 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf0e9b50910b10166d23cb37e9f5b4b0@codeaurora.org \
--to=subhashj@codeaurora.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tomas.winkler@intel.com \
--cc=vinholikatti@gmail.com \
--cc=ygardi@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.