linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>, linux-pm@vger.kernel.org
Subject: Re: [PATCH] s5pv210-cpufreq: fix wrong do_div() usage
Date: Wed, 4 Nov 2015 07:20:33 +0530	[thread overview]
Message-ID: <20151104015033.GN3685@ubuntu> (raw)
In-Reply-To: <alpine.LFD.2.20.1511031706460.630@knanqh.ubzr>

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

  parent reply	other threads:[~2015-11-04  1:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-11-05 22:34   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151104015033.GN3685@ubuntu \
    --to=viresh.kumar@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).