All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] ARM:rmobile: Correct get_time_ms / get_time_us to use lldiv
@ 2013-12-05 19:48 Tom Rini
  2013-12-05 19:48 ` [U-Boot] [PATCH 2/5] ARM:zynq: Correct __udelay " Tom Rini
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Tom Rini @ 2013-12-05 19:48 UTC (permalink / raw)
  To: u-boot

Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Tom Rini <trini@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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-12-16 14:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05 19:48 [U-Boot] [PATCH 1/5] ARM:rmobile: Correct get_time_ms / get_time_us to use lldiv Tom Rini
2013-12-05 19:48 ` [U-Boot] [PATCH 2/5] ARM:zynq: Correct __udelay " Tom Rini
2013-12-16 14:16   ` [U-Boot] [U-Boot,2/5] " Tom Rini
2013-12-05 19:48 ` [U-Boot] [PATCH 3/5] ARM:PXA: Correct tick_to_time / us_to_tick " Tom Rini
2013-12-06  1:15   ` Marek Vasut
2013-12-16 14:16   ` [U-Boot] [U-Boot, " Tom Rini
2013-12-05 19:48 ` [U-Boot] [PATCH 4/5] JFFS2: Correct jffs2_1pass_build_lists " Tom Rini
2013-12-16 14:16   ` [U-Boot] [U-Boot, " Tom Rini
2013-12-05 19:48 ` [U-Boot] [PATCH 5/5] yaffs2: Use lldiv for 64bit division Tom Rini
2013-12-16 14:16   ` [U-Boot] [U-Boot,5/5] " Tom Rini
2013-12-06  0:31 ` [U-Boot] [PATCH 1/5] ARM:rmobile: Correct get_time_ms / get_time_us to use lldiv Nobuhiro Iwamatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.