public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] soc: qcom: dcc: Fix unsigned comparison with less than zero
@ 2023-01-06  1:17 Yang Li
  2023-01-06 20:24 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2023-01-06  1:17 UTC (permalink / raw)
  To: quic_schowdhu
  Cc: agross, andersson, konrad.dybcio, linux-arm-msm, linux-kernel,
	Yang Li, Abaci Robot

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-06 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06  1:17 [PATCH -next] soc: qcom: dcc: Fix unsigned comparison with less than zero Yang Li
2023-01-06 20:24 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox