Skip to content

Commit

Permalink
cpufreq: exynos: Fix unsigned variable being checked for negative value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Kukjin Kim committed Jan 25, 2013
1 parent 6e45eb1 commit d271d07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cpufreq/exynos-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
struct cpufreq_policy *policy = cpufreq_cpu_get(0);
unsigned int arm_volt, safe_arm_volt = 0;
unsigned int mpll_freq_khz = exynos_info->mpll_freq_khz;
unsigned int index, old_index;
int index, old_index;
int ret = 0;

freqs.old = policy->cur;
Expand Down

0 comments on commit d271d07

Please sign in to comment.