Re: [PM-WIP-OPP] [PATCH] cleaner ceil function for uv to vsel conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Romit Dasgupta <romit@xxxxxx> 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@xxxxxx>
> ---
> 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;
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux