[PATCHv2] clk: actions: owl-pll: cast delay to unsigned long for udelay()

Rosen Penev posted 1 patch 1 week, 6 days ago
drivers/clk/actions/owl-pll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCHv2] clk: actions: owl-pll: cast delay to unsigned long for udelay()
Posted by Rosen Penev 1 week, 6 days ago
The 'delay' field in struct owl_pll_hw is u8, but udelay() internally
compares its argument against MAX_UDELAY_MS * 1000 (2000). Since a u8
can never exceed 255, the compiler warns of a tautological comparison
that is always false:

  drivers/clk/actions/owl-pll.c:189:2: error: result of comparison of
  constant 2000 with expression of type 'u8' is always false

Cast the delay value to unsigned long to widen the type and silence the
W=1 warning without changing behavior.

Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 v2: fix uelay typo. mention W=1.
 drivers/clk/actions/owl-pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/actions/owl-pll.c b/drivers/clk/actions/owl-pll.c
index 869690b79cc1..5e30ce35f2f5 100644
--- a/drivers/clk/actions/owl-pll.c
+++ b/drivers/clk/actions/owl-pll.c
@@ -186,7 +186,7 @@ static int owl_pll_set_rate(struct clk_hw *hw, unsigned long rate,
 
 	regmap_write(common->regmap, pll_hw->reg, reg);
 
-	udelay(pll_hw->delay);
+	udelay((unsigned long)pll_hw->delay);
 
 	return 0;
 }
-- 
2.55.0
Re: [PATCHv2] clk: actions: owl-pll: cast delay to unsigned long for udelay()
Posted by Brian Masney 1 week ago
On Fri, 11 Sep 2026 17:05:27 -0700, Rosen Penev wrote:
> clk: actions: owl-pll: cast delay to unsigned long for udelay()

Applied, thanks!

[1/1] clk: actions: owl-pll: cast delay to unsigned long for udelay()
      commit: 46c51c413242870a59f64d3c11df25d6693f6fb6

Best regards,
-- 
Brian Masney <bmasney@redhat.com>