From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: mturquette@baylibre.com
Cc: sboyd@kernel.org, orsonzhai@gmail.com,
baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH] clk: sprd: composite: Fix unsigned comparison with less than zero
Date: Wed, 14 Jun 2023 09:30:35 +0800 [thread overview]
Message-ID: <20230614013035.123796-1-jiapeng.chong@linux.alibaba.com> (raw)
The rate is defined as unsigned long type, if(rate<0) is invalid, modify
to int type.
drivers/clk/sprd/composite.c:20 sprd_comp_determine_rate() warn: unsigned 'rate' is never less than zero.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5520
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/clk/sprd/composite.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/sprd/composite.c b/drivers/clk/sprd/composite.c
index d3a852720c07..1c0390e8342e 100644
--- a/drivers/clk/sprd/composite.c
+++ b/drivers/clk/sprd/composite.c
@@ -13,7 +13,7 @@ static int sprd_comp_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct sprd_comp *cc = hw_to_sprd_comp(hw);
- unsigned long rate;
+ int rate;
rate = sprd_div_helper_round_rate(&cc->common, &cc->div,
req->rate, &req->best_parent_rate);
--
2.20.1.7.g153144c
reply other threads:[~2023-06-14 1:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230614013035.123796-1-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=abaci@linux.alibaba.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=orsonzhai@gmail.com \
--cc=sboyd@kernel.org \
--cc=zhang.lyra@gmail.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
all inboxes | Powered by JetHome®