[U-Boot] [PATCH] arm: zynq: correct the argument to lldiv

Siva Durga Prasad Paladugu siva.durga.paladugu at xilinx.com
Mon Feb 17 07:12:39 CET 2014


Typecast the argument with unsigned long
long for proper calculation of lldiv

Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
---
-Fixes the issue of rounding of the multiplication result to
 32-bit value
---
 arch/arm/cpu/armv7/zynq/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/zynq/timer.c b/arch/arm/cpu/armv7/zynq/timer.c
index 2be253c..09a5547 100644
--- a/arch/arm/cpu/armv7/zynq/timer.c
+++ b/arch/arm/cpu/armv7/zynq/timer.c
@@ -107,7 +107,8 @@ void __udelay(unsigned long usec)
 	if (usec == 0)
 		return;
 
-	countticks = lldiv(TIMER_TICK_HZ * usec, 1000000);
+	countticks = lldiv(((unsigned long long)TIMER_TICK_HZ * usec),
+			   1000000);
 
 	/* decrementing timer */
 	timeend = readl(&timer_base->counter) - countticks;
-- 
1.7.4




More information about the U-Boot mailing list