[U-Boot] [PATCH] ARM: Use do_div() instead of division for "long long".

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Oct 24 13:30:41 CEST 2008


>  #include <asm/proc-armv/ptrace.h>
>  #include <s3c6400.h>
> +#include <div64.h>
>  
>  static ulong timer_load_val;
>  
> @@ -148,7 +149,9 @@ void reset_timer(void)
>  
>  ulong get_timer_masked(void)
>  {
> -	return get_ticks() / (timer_load_val / (100 * CFG_HZ));
> +	unsigned long long res = get_ticks();
> +	do_div (res, (timer_load_val / (100 * CFG_HZ)));
> +	return res;
	CFG_HZ was renamed CONFIG_SYS_HZ
>  }

I've start to think to re-rename it CFG_HZ as done in Linux, normaly this
value is the same for all arch & board

Best Regards,
J.


More information about the U-Boot mailing list