Message ID | alpine.LFD.2.20.1511031706460.630@knanqh.ubzr (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Rafael Wysocki |
Headers | show |
2015-11-04 7:13 GMT+09:00 Nicolas Pitre <nicolas.pitre@linaro.org>: > 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> > Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Best regards, Krzysztof -- 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
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>
On Wednesday, November 04, 2015 07:20:33 AM Viresh Kumar wrote: > 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> Applied, thanks! Rafael -- 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