public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: "Dasgupta, Romit" <romit@ti.com>
Cc: "paul@pwsan.com" <paul@pwsan.com>,
	"khilman@deeprootsystems.com" <khilman@deeprootsystems.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/10] OPP layer and additional cleanups.
Date: Mon, 4 Jan 2010 16:04:59 -0600	[thread overview]
Message-ID: <4B42660B.1020304@ti.com> (raw)
In-Reply-To: <1262266145.20175.177.camel@boson>

Dasgupta, Romit had written, on 12/31/2009 07:29 AM, the following:
> Cleaner way to take care of the precision loss during integer division.
> 
please sign-off your patch and fix subject.
> 
> diff --git a/arch/arm/plat-omap/opp_twl_tps.c b/arch/arm/plat-omap/opp_twl_tps.c
> index e0db39b..43dee2d 100644
> --- a/arch/arm/plat-omap/opp_twl_tps.c
> +++ b/arch/arm/plat-omap/opp_twl_tps.c
> @@ -36,14 +36,7 @@ unsigned long omap_twl_vsel_to_uv(const u8 vsel)
>   */
>  u8 omap_twl_uv_to_vsel(unsigned long uv)
>  {
> -	u8 vsel;
> +	/* Takes care of precision loss due to integer division */
> +	return (((uv + 99) / 100 - 6000) + 124) / 125;
>  
> -	vsel = ((uv / 100) - 6000) / 125;
> -
> -	/* round off to higher voltage */
> -	/* XXX Surely not the best way to handle this. */
> -	if (uv > omap_twl_vsel_to_uv(vsel))
> -		vsel++;
> -
> -	return vsel;
>  }
> 
> 
Nice, thanks.
Acked-by: Nishanth Menon <nm@ti.com>

-- 
Regards,
Nishanth Menon

      reply	other threads:[~2010-01-04 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-31 13:29 [PATCH 1/10] OPP layer and additional cleanups Romit Dasgupta
2010-01-04 22:04 ` Nishanth Menon [this message]

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=4B42660B.1020304@ti.com \
    --to=nm@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=romit@ti.com \
    /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