linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] s5pv210-cpufreq: fix wrong do_div() usage
@ 2015-11-03 22:13 Nicolas Pitre
  2015-11-04  0:41 ` Krzysztof Kozlowski
  2015-11-04  1:50 ` Viresh Kumar
  0 siblings, 2 replies; 4+ messages in thread
From: Nicolas Pitre @ 2015-11-03 22:13 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar; +Cc: linux-pm

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);
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-05 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 22:13 [PATCH] s5pv210-cpufreq: fix wrong do_div() usage Nicolas Pitre
2015-11-04  0:41 ` Krzysztof Kozlowski
2015-11-04  1:50 ` Viresh Kumar
2015-11-05 22:34   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).