diff mbox

[U-Boot] cmd_dhry.c: Use lldiv for vax_mips calculation as well

Message ID 1458224119-18300-1-git-send-email-trini@konsulko.com
State Accepted
Commit f23baa572f96e1e13d7f1a3c8addb61b5d0dbd29
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini March 17, 2016, 2:15 p.m. UTC
Since dhry_per_sec is a u64 we must also use lldiv here when working
with it.  Otherwise:
../lib/dhry/cmd_dhry.c:(.text.do_dhry+0xd8): undefined reference to `__udivdi3'

On some platforms.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 lib/dhry/cmd_dhry.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini March 17, 2016, 2:20 p.m. UTC | #1
On Thu, Mar 17, 2016 at 10:15:19AM -0400, Tom Rini wrote:

> Since dhry_per_sec is a u64 we must also use lldiv here when working
> with it.  Otherwise:
> ../lib/dhry/cmd_dhry.c:(.text.do_dhry+0xd8): undefined reference to `__udivdi3'
> 
> On some platforms.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/lib/dhry/cmd_dhry.c b/lib/dhry/cmd_dhry.c
index d7e1e6a..f44305b 100644
--- a/lib/dhry/cmd_dhry.c
+++ b/lib/dhry/cmd_dhry.c
@@ -22,7 +22,7 @@  static int do_dhry(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	dhry(iterations);
 	duration = get_timer(start);
 	dhry_per_sec = lldiv(iterations * 1000ULL, duration);
-	vax_mips = dhry_per_sec / 1757;
+	vax_mips = lldiv(dhry_per_sec, 1757);
 	printf("%d iterations in %lu ms: %lu/s, %lu DMIPS\n", iterations,
 	       duration, (ulong)dhry_per_sec, vax_mips);