public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: romit@ti.com
Cc: nm@ti.com, linux-omap@vger.kernel.org
Subject: Re: [PM-WIP-OPP] [PATCH] cleaner ceil function for uv to vsel conversion
Date: Mon, 11 Jan 2010 14:29:01 -0800	[thread overview]
Message-ID: <876378mg2a.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1263189218.16324.3.camel@boson> (Romit Dasgupta's message of "Mon\, 11 Jan 2010 11\:23\:38 +0530")

Romit Dasgupta <romit@ti.com> writes:

> Cleaner ceil function.

Needs better subject and better changelog.

Subject should probably be something like: OMAP: 

  [PATCH] OPP: TWL/TPS: optimize uv to vsel function

And changelog should describe the motiviation for the patch or a
description of the problem you're trying to solve.  IOW, is this a
correctness fix, or an optimization, etc.  Looks to me like it's tring
to compensate for some rounding issues, but please describe in detail
in the changelog.

Thanks,

Kevin


> Signed-off-by: Romit Dasgupta <romit@ti.com>
> ---
> diff --git a/arch/arm/plat-omap/opp_twl_tps.c b/arch/arm/plat-omap/opp_twl_tps.c
> index e0db39b..1caa414 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;
>  
> -	vsel = ((uv / 100) - 6000) / 125;
> +	return (((uv + 99) / 100 - 6000) + 124) / 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;
>  }

  reply	other threads:[~2010-01-11 22:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11  5:53 [PM-WIP-OPP] [PATCH] cleaner ceil function for uv to vsel conversion Romit Dasgupta
2010-01-11 22:29 ` Kevin Hilman [this message]
2010-01-12  8:58   ` Romit Dasgupta
2010-01-12 12:08     ` Nishanth Menon
2010-01-12 12:13       ` Romit Dasgupta

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=876378mg2a.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.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