From: Yang Li <yang.lee@linux.alibaba.com>
To: quic_schowdhu@quicinc.com
Cc: agross@kernel.org, andersson@kernel.org,
konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Yang Li <yang.lee@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH -next] soc: qcom: dcc: Fix unsigned comparison with less than zero
Date: Fri, 6 Jan 2023 09:17:10 +0800 [thread overview]
Message-ID: <20230106011710.2827-1-yang.lee@linux.alibaba.com> (raw)
The return value from the call to kstrtouint_from_user() is int.
However, the return value is being assigned to
an unsigned int variable 'ret', so making 'ret' an int.
Eliminate the following warning:
./drivers/soc/qcom/dcc.c:815:5-8: WARNING: Unsigned expression compared with zero: ret < 0
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3638
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/soc/qcom/dcc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/dcc.c b/drivers/soc/qcom/dcc.c
index d4101f79cb5d..5b50d638771d 100644
--- a/drivers/soc/qcom/dcc.c
+++ b/drivers/soc/qcom/dcc.c
@@ -808,7 +808,8 @@ static ssize_t config_reset_write(struct file *filp,
const char __user *user_buf, size_t count,
loff_t *ppos)
{
- unsigned int val, ret;
+ unsigned int val;
+ int ret;
struct dcc_drvdata *drvdata = filp->private_data;
ret = kstrtouint_from_user(user_buf, count, 0, &val);
--
2.20.1.7.g153144c
next reply other threads:[~2023-01-06 1:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 1:17 Yang Li [this message]
2023-01-06 20:24 ` [PATCH -next] soc: qcom: dcc: Fix unsigned comparison with less than zero Bjorn Andersson
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=20230106011710.2827-1-yang.lee@linux.alibaba.com \
--to=yang.lee@linux.alibaba.com \
--cc=abaci@linux.alibaba.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_schowdhu@quicinc.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox