[U-Boot] [PATCH 1/5] ARM:rmobile: Correct get_time_ms / get_time_us to use lldiv

Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj at renesas.com
Fri Dec 6 01:31:00 CET 2013


Hi, Tom.

Thanks for your patch.
But I already sent a same patch as yours.
  http://patchwork.ozlabs.org/patch/294819/

Best regards,
  Nobuhiro

2013/12/6 Tom Rini <trini at ti.com>:
> Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
> Signed-off-by: Tom Rini <trini at ti.com>
> ---
>  arch/arm/cpu/armv7/rmobile/timer.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/rmobile/timer.c b/arch/arm/cpu/armv7/rmobile/timer.c
> index 72e0c12..67a5a7a 100644
> --- a/arch/arm/cpu/armv7/rmobile/timer.c
> +++ b/arch/arm/cpu/armv7/rmobile/timer.c
> @@ -6,6 +6,7 @@
>   */
>
>  #include <common.h>
> +#include <div64.h>
>  #include <asm/io.h>
>  #include <asm/arch-armv7/globaltimer.h>
>  #include <asm/arch/rmobile.h>
> @@ -38,13 +39,12 @@ static u64 get_time_us(void)
>         u64 timer = get_cpu_global_timer();
>
>         timer = ((timer << 2) + (CLK2MHZ(CONFIG_SYS_CPU_CLK) >> 1));
> -       timer /= (u64)CLK2MHZ(CONFIG_SYS_CPU_CLK);
> -       return timer;
> +       return lldiv(timer, CLK2MHZ(CONFIG_SYS_CPU_CLK));
>  }
>
>  static ulong get_time_ms(void)
>  {
> -       return (ulong)(get_time_us() / 1000);
> +       return lldiv(get_time_us(), 1000);
>  }
>
>  int timer_init(void)
> --
> 1.7.9.5
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



-- 
Nobuhiro Iwamatsu


More information about the U-Boot mailing list