diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-01-25 13:18:09 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-01-25 13:18:09 -0500 |
commit | d271d077ac66e839a0f443f1089a0af1ef15fd51 (patch) | |
tree | 1f75726f03c5987e26de4b8abb6c780a7f50f164 /drivers/cpufreq | |
parent | 6e45eb12fd1c741d556bf264ee98853b5f3104e5 (diff) |
cpufreq: exynos: Fix unsigned variable being checked for negative value
exynos_cpufreq_scale function returns signed value which was
assigned to an unsigned variable and checked for negative value which
is always false. Hence make it signed.
Fixes the following smatch warnings:
drivers/cpufreq/exynos-cpufreq.c:83 exynos_cpufreq_scale() warn: unsigned 'old_index' is never less than zero.
drivers/cpufreq/exynos-cpufreq.c:89 exynos_cpufreq_scale() warn: unsigned 'index' is never less than zero.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/exynos-cpufreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 0840358bf3bc..c8c7653a6033 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c | |||
@@ -65,7 +65,7 @@ static int exynos_cpufreq_scale(unsigned int target_freq) | |||
65 | struct cpufreq_policy *policy = cpufreq_cpu_get(0); | 65 | struct cpufreq_policy *policy = cpufreq_cpu_get(0); |
66 | unsigned int arm_volt, safe_arm_volt = 0; | 66 | unsigned int arm_volt, safe_arm_volt = 0; |
67 | unsigned int mpll_freq_khz = exynos_info->mpll_freq_khz; | 67 | unsigned int mpll_freq_khz = exynos_info->mpll_freq_khz; |
68 | unsigned int index, old_index; | 68 | int index, old_index; |
69 | int ret = 0; | 69 | int ret = 0; |
70 | 70 | ||
71 | freqs.old = policy->cur; | 71 | freqs.old = policy->cur; |