Re: [PATCH] cpufreq: fix sign check of an unsigned variable in cpufreq-cpu0
From: Viresh Kumar
Date: Mon Feb 25 2013 - 07:09:54 EST
On Mon, Feb 25, 2013 at 5:02 PM, Guennadi Liakhovetski
<g.liakhovetski@xxxxxx> wrote:
> A "< 0" test for an unsigned variable is meaningless, change the variable
> to signed.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
> ---
>
> stable?
>
> drivers/cpufreq/cpufreq-cpu0.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
> index 52bf36d..e7bad3c 100644
> --- a/drivers/cpufreq/cpufreq-cpu0.c
> +++ b/drivers/cpufreq/cpufreq-cpu0.c
> @@ -44,7 +44,8 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
> {
> struct cpufreq_freqs freqs;
> struct opp *opp;
> - unsigned long freq_Hz, volt = 0, volt_old = 0, tol = 0;
> + unsigned long volt = 0, volt_old = 0, tol = 0;
> + long freq_Hz;
Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
The disease is spread across a bigger region though.
@Mike: clk_round_rate returns long and __clk_round_rate returns unsigned long
and clk_ops->round_rate returns long again.. Don't you see something
strange here?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/