[<prev] [next>] [day] [month] [year] [list]
Message-Id: <03d0c47832c7a0fdc19733d15077197ad2c54946.1756430095.git.xiaopei01@kylinos.cn>
Date: Fri, 29 Aug 2025 09:16:24 +0800
From: Pei Xiao <xiaopei01@...inos.cn>
To: sboyd@...nel.org,
thierry.reding@...il.com,
linux-clk@...r.kernel.org,
linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Pei Xiao <xiaopei01@...inos.cn>
Subject: [PATCH] clk: tegra: super: Fix error handling and resolve unsigned compare warning
./drivers/clk/tegra/clk-super.c:156:5-9: WARNING:
Unsigned expression compared with zero: rate < 0
The unsigned long 'rate' variable caused:
- Incorrect handling of negative errors
- Compile warning: "Unsigned expression compared with zero"
Fix by changing to long type and adding req->rate cast.
Signed-off-by: Pei Xiao <xiaopei01@...inos.cn>
---
drivers/clk/tegra/clk-super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/tegra/clk-super.c b/drivers/clk/tegra/clk-super.c
index 7ec47942720c..643b3cb83cd0 100644
--- a/drivers/clk/tegra/clk-super.c
+++ b/drivers/clk/tegra/clk-super.c
@@ -147,7 +147,7 @@ static int clk_super_determine_rate(struct clk_hw *hw,
{
struct tegra_clk_super_mux *super = to_clk_super_mux(hw);
struct clk_hw *div_hw = &super->frac_div.hw;
- unsigned long rate;
+ long rate;
__clk_hw_set_clk(div_hw, hw);
@@ -156,7 +156,7 @@ static int clk_super_determine_rate(struct clk_hw *hw,
if (rate < 0)
return rate;
- req->rate = rate;
+ req->rate = (unsigned long)rate;
return 0;
}
--
2.25.1
Powered by blists - more mailing lists