Skip to contentSkip to conversation

clk: sprd: composite: Fix unsigned comparison with less than zero

PATCH New Jiapeng Chong 1 participant 1 message Jun 14, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: sprd: composite: Fix unsigned comparison with less than zero

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.

---
 drivers/clk/sprd/composite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sprd/composite.c +1 -1
index d3a852720c07..1c0390e8342e 100644
@@ -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);
Signature · 1 line
2.20.1.7.g153144c