All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: zynq: correct the argument to lldiv
@ 2014-02-17  6:12 Siva Durga Prasad Paladugu
  2014-02-17  6:50 ` Michal Simek
  0 siblings, 1 reply; 4+ messages in thread
From: Siva Durga Prasad Paladugu @ 2014-02-17  6:12 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@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

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

end of thread, other threads:[~2014-02-17  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17  6:12 [U-Boot] [PATCH] arm: zynq: correct the argument to lldiv Siva Durga Prasad Paladugu
2014-02-17  6:50 ` Michal Simek
2014-02-17  9:07   ` Albert ARIBAUD
2014-02-17  9:10     ` Michal Simek

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.