Skip to contentSkip to conversation

ASoC: tlv320aic32x4: pll: Remove impossible condition in clk_aic32x4_pll_determine_rate()

PATCH Applied Stephen Boyd 2 participants 3 messages Jun 13, 2023

Subsystems (4)
lore
Share & tools
lore

Stephen Boyd

author maintainer
#0 lore raw

PATCH 1/1 ASoC: tlv320aic32x4: pll: Remove impossible condition in clk_aic32x4_pll_determine_rate()

Smatch warns:

sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero.

Cc Maxime Ripard <[email protected]>
Fixes 25d43ec352ea ("ASoC: tlv320aic32x4: pll: Switch to determine_rate")
---
 sound/soc/codecs/tlv320aic32x4-clk.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
sound/soc/codecs/tlv320aic32x4-clk.c +1 -5
index a7ec501b4c69..c116e82f712d 100644
@@ -208,18 +208,14 @@ static int clk_aic32x4_pll_determine_rate(struct clk_hw *hw,
 					  struct clk_rate_request *req)
 {
 	struct clk_aic32x4_pll_muldiv settings;
-	unsigned long rate;
 	int ret;
 
 	ret = clk_aic32x4_pll_calc_muldiv(&settings, req->rate, req->best_parent_rate);
 	if (ret < 0)
 		return -EINVAL;
 
-	rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate);
-	if (rate < 0)
-		return rate;
+	req->rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate);
 
-	req->rate = rate;
 	return 0;
 }
 
Signature · 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Stephen Boyd

Smatch warns:

sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero.

Cc Maxime Ripard <[email protected]>
Fixes 25d43ec352ea ("ASoC: tlv320aic32x4: pll: Switch to determine_rate")

Thanks for taking care of this

Maxime

author maintainer Applied
#2 lore raw
In reply to Stephen Boyd

Quoting Stephen Boyd (2023-06-12 18:12:00)

Quoted 10 lines

Smatch warns:

sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero.

Cc Maxime Ripard <[email protected]>
Fixes 25d43ec352ea ("ASoC: tlv320aic32x4: pll: Switch to determine_rate")

---

Applied to clk-next