Message ID | alpine.LFD.2.20.1511031706460.630@knanqh.ubzr |
---|---|
State | New |
Headers | show |
On 03-11-15, 17:13, Nicolas Pitre wrote: > It is wrong to use do_div() with 32-bit dividends (unsigned long is > 32 bits on 32-bit architectures). > > Signed-off-by: Nicolas Pitre <nico@linaro.org> > > diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c > index 9e231f5215..051a8a8224 100644 > --- a/drivers/cpufreq/s5pv210-cpufreq.c > +++ b/drivers/cpufreq/s5pv210-cpufreq.c > @@ -212,11 +212,11 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq) > /* Find current DRAM frequency */ > tmp = s5pv210_dram_conf[ch].freq; > > - do_div(tmp, freq); > + tmp /= freq; > > tmp1 = s5pv210_dram_conf[ch].refresh; > > - do_div(tmp1, tmp); > + tmp1 /= tmp; > > __raw_writel(tmp1, reg); > } Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 9e231f5215..051a8a8224 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c @@ -212,11 +212,11 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq) /* Find current DRAM frequency */ tmp = s5pv210_dram_conf[ch].freq; - do_div(tmp, freq); + tmp /= freq; tmp1 = s5pv210_dram_conf[ch].refresh; - do_div(tmp1, tmp); + tmp1 /= tmp; __raw_writel(tmp1, reg); }
It is wrong to use do_div() with 32-bit dividends (unsigned long is 32 bits on 32-bit architectures). Signed-off-by: Nicolas Pitre <nico@linaro.org> -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html