]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: tegra: periph: Fix error handling and resolve unsigned compare warning
authorPei Xiao <xiaopei01@kylinos.cn>
Wed, 9 Jul 2025 07:37:13 +0000 (15:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:25 +0000 (16:28 +0200)
commit6c9e12fef997a09150ff08843aeb6f0a0fb3f9de
tree8d565c8d1e947175c51e449ed8c5e4c73cbe0ce5
parentd960f4b793912f35e9d72bd9d1e90553063fcbf1
clk: tegra: periph: Fix error handling and resolve unsigned compare warning

[ Upstream commit 2dc2ca9000eea2eb749f658196204cb84d4306f7 ]

./drivers/clk/tegra/clk-periph.c:59: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@kylinos.cn>
Link: https://lore.kernel.org/r/79c7f01e29876c612e90d6d0157fb1572ca8b3fb.1752046270.git.xiaopei01@kylinos.cn
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/tegra/clk-periph.c