public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 1/3] clk: sprd: composite: Fix unsigned comparison with less than zero
@ 2023-06-14  1:29 Yang Li
  2023-06-14  1:29 ` [PATCH -next 2/3] clk: stm32: core: " Yang Li
  2023-06-14  1:29 ` [PATCH -next 3/3] clk: tegra: " Yang Li
  0 siblings, 2 replies; 5+ messages in thread
From: Yang Li @ 2023-06-14  1:29 UTC (permalink / raw)
  To: sboyd
  Cc: mturquette, orsonzhai, baolin.wang, zhang.lyra, pdeschrijver,
	pgaikwad, thierry.reding, jonathanh, linux-clk, linux-kernel,
	Yang Li, Abaci Robot

The return value of the sprd_div_helper_round_rate() is long.
However, the return value is being assigned to an unsigned
long variable 'rate', so making 'rate' to long.

silence the warning:
./drivers/clk/sprd/composite.c:20:5-9: WARNING: Unsigned expression
compared with zero: rate < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5519
Signed-off-by: Yang Li <yang.lee@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..e4d22d8f113f 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;
+	long rate;
 
 	rate = sprd_div_helper_round_rate(&cc->common, &cc->div,
 					  req->rate, &req->best_parent_rate);
-- 
2.20.1.7.g153144c


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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14  1:29 [PATCH -next 1/3] clk: sprd: composite: Fix unsigned comparison with less than zero Yang Li
2023-06-14  1:29 ` [PATCH -next 2/3] clk: stm32: core: " Yang Li
2023-06-14 19:57   ` Stephen Boyd
2023-06-14  1:29 ` [PATCH -next 3/3] clk: tegra: " Yang Li
2023-06-14 20:01   ` Stephen Boyd

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