From: Andrew Goodbody Date: Wed, 23 Jul 2025 16:04:41 +0000 (+0100) Subject: clk: exynos: Fix always true test X-Git-Tag: v2025.10-rc4~5^2~14 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c901732558fbee5b798bb7a065f7832d3a6bbc84;p=pandora-u-boot.git clk: exynos: Fix always true test In exynos7420_peric1_get_rate the variable ret is declared as an 'unsigned int' but is then used to receive the return value of clk_get_by_index which returns an int. The value of ret is then tested for being less than 0 which will always fail for an unsigned variable. Fix this by declaring ret as an 'int' so that the test for the error condition is valid. This issue was found by Smatch. Signed-off-by: Andrew Goodbody Signed-off-by: Minkyu Kang --- diff --git a/drivers/clk/exynos/clk-exynos7420.c b/drivers/clk/exynos/clk-exynos7420.c index 3aa751bf4e4..7de4e688f03 100644 --- a/drivers/clk/exynos/clk-exynos7420.c +++ b/drivers/clk/exynos/clk-exynos7420.c @@ -192,7 +192,7 @@ static int exynos7420_clk_top0_probe(struct udevice *dev) static ulong exynos7420_peric1_get_rate(struct clk *clk) { struct clk in_clk; - unsigned int ret; + int ret; unsigned long freq = 0; switch (clk->id) {