Commit 19ea4678ca5ce4c3a626039ed7642d4e0fbfdee1

Authored by Simon Glass
Committed by Tom Rini
1 parent aac618a32b

Use uint64_t for time types

Unfortunately 'unsigned long long' and 'uint64_t' are not necessarily
compatible on 64-bit machines. Use the correct typedef instead of
writing the supposed type out in full.

Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 7 additions and 7 deletions Side-by-side Diff

... ... @@ -766,7 +766,7 @@
766 766 void invalidate_icache_all(void);
767 767  
768 768 /* arch/$(ARCH)/lib/ticks.S */
769   -unsigned long long get_ticks(void);
  769 +uint64_t get_ticks(void);
770 770 void wait_ticks (unsigned long);
771 771  
772 772 /* arch/$(ARCH)/lib/time.c */
... ... @@ -37,7 +37,7 @@
37 37 extern unsigned long __weak timer_read_counter(void);
38 38 #endif
39 39  
40   -unsigned long long __weak notrace get_ticks(void)
  40 +uint64_t __weak notrace get_ticks(void)
41 41 {
42 42 unsigned long now = timer_read_counter();
43 43  
44 44  
... ... @@ -45,11 +45,11 @@
45 45 if (now < gd->timebase_l)
46 46 gd->timebase_h++;
47 47 gd->timebase_l = now;
48   - return ((unsigned long long)gd->timebase_h << 32) | gd->timebase_l;
  48 + return ((uint64_t)gd->timebase_h << 32) | gd->timebase_l;
49 49 }
50 50  
51 51 /* Returns time in milliseconds */
52   -static unsigned long long notrace tick_to_time(unsigned long long tick)
  52 +static uint64_t notrace tick_to_time(uint64_t tick)
53 53 {
54 54 ulong div = get_tbclk();
55 55  
56 56  
... ... @@ -74,9 +74,9 @@
74 74 return tick_to_time(get_ticks() * 1000);
75 75 }
76 76  
77   -static unsigned long long usec_to_tick(unsigned long usec)
  77 +static uint64_t usec_to_tick(unsigned long usec)
78 78 {
79   - unsigned long long tick = usec;
  79 + uint64_t tick = usec;
80 80 tick *= get_tbclk();
81 81 do_div(tick, 1000000);
82 82 return tick;
... ... @@ -84,7 +84,7 @@
84 84  
85 85 void __weak __udelay(unsigned long usec)
86 86 {
87   - unsigned long long tmp;
  87 + uint64_t tmp;
88 88  
89 89 tmp = get_ticks() + usec_to_tick(usec); /* get current timestamp */
90 90