From: Nicolas Pitre Date: Tue, 3 Nov 2015 22:13:57 +0000 (-0500) Subject: cpufreq: s5pv210-cpufreq: fix wrong do_div() usage X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d7e53e35f9f54cdfa09a8456ae8e9874ec66bb36;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git cpufreq: s5pv210-cpufreq: fix wrong do_div() usage 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 Reviewed-by: Krzysztof Kozlowski Reviewed-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index 9e231f52150c..051a8a8224cd 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); }