mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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 <andrew.goodbody@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
committed by
Minkyu Kang
parent
3dc5e9a010
commit
c901732558
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user