Skip to contentSkip to conversation

time: fix gcc warnings on MIPS64

PATCH In review Daniel Schwierzeck 2 participants 2 messages Nov 8, 2013 – Nov 11, 2013 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 time: fix gcc warnings on MIPS64

Commit 8dfafdde88eb3e71d5569846396ae67a91017232 introduced new gcc warnings on MIPS64:

time.c: In function 'tick_to_time':
time.c:59:2: warning: comparison of distinct pointer types lacks a cast [enabled by default] time.c:59:2: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default] In file included from time.c:10:0:
./u-boot-mips/include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *' time.c: In function 'usec_to_tick':
time.c:76:2: warning: comparison of distinct pointer types lacks a cast [enabled by default] time.c:76:2: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default] In file included from time.c:10:0:
./u-boot-mips/include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

---
 lib/time.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/time.c +2 -2
index 111b493..09bb05a 100644
@@ -51,7 +51,7 @@ unsigned long long __weak notrace get_ticks(void)
 	return ((unsigned long long)gd->timebase_h << 32) | gd->timebase_l;
 }
 
-static unsigned long long notrace tick_to_time(unsigned long long tick)
+static unsigned long long notrace tick_to_time(uint64_t tick)
 {
 	unsigned int div = get_tbclk();
 
@@ -71,7 +71,7 @@ unsigned long __weak notrace timer_get_us(void)
 }
 static unsigned long long usec_to_tick(unsigned long usec)
 {
-	unsigned long long tick = usec * get_tbclk();
+	uint64_t tick = usec * get_tbclk();
 	usec *= get_tbclk();
 	do_div(tick, 1000000);
 	return tick;
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 14 lines · Daniel Schwierzeck

Commit 8dfafdde88eb3e71d5569846396ae67a91017232 introduced new gcc warnings on MIPS64:

time.c: In function 'tick_to_time':
time.c:59:2: warning: comparison of distinct pointer types lacks a cast [enabled by default] time.c:59:2: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default] In file included from time.c:10:0:
./u-boot-mips/include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *' time.c: In function 'usec_to_tick':
time.c:76:2: warning: comparison of distinct pointer types lacks a cast [enabled by default] time.c:76:2: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default] In file included from time.c:10:0:
./u-boot-mips/include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Quoted 1 line

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131111/fcbd2bbd/attachment.pgp>