summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/display_options.c14
-rw-r--r--lib/lmb.c2
-rw-r--r--lib/time.c12
-rw-r--r--lib/vsprintf.c2
4 files changed, 13 insertions, 17 deletions
diff --git a/lib/display_options.c b/lib/display_options.c
index 4c0c886d61..d5d17b2818 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <common.h>
+#include <inttypes.h>
#include <version.h>
#include <linux/ctype.h>
#include <asm/io.h>
@@ -21,15 +22,10 @@ int display_options (void)
return 0;
}
-/*
- * print sizes as "xxx KiB", "xxx.y KiB", "xxx MiB", "xxx.y MiB",
- * xxx GiB, xxx.y GiB, etc as needed; allow for optional trailing string
- * (like "\n")
- */
-void print_size(unsigned long long size, const char *s)
+void print_size(uint64_t size, const char *s)
{
unsigned long m = 0, n;
- unsigned long long f;
+ uint64_t f;
static const char names[] = {'E', 'P', 'T', 'G', 'M', 'K'};
unsigned long d = 10 * ARRAY_SIZE(names);
char c = 0;
@@ -43,7 +39,7 @@ void print_size(unsigned long long size, const char *s)
}
if (!c) {
- printf("%llu Bytes%s", size, s);
+ printf("%" PRIu64 " Bytes%s", size, s);
return;
}
@@ -127,7 +123,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
else
x = lb.uc[i] = *(volatile uint8_t *)data;
#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
- printf(" %0*llx", width * 2, x);
+ printf(" %0*" PRIx64, width * 2, x);
#else
printf(" %0*x", width * 2, x);
#endif
diff --git a/lib/lmb.c b/lib/lmb.c
index 41a2be4635..031f0e1ac8 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -236,7 +236,7 @@ long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size)
return lmb_add_region(_rgn, base, size);
}
-long lmb_overlaps_region(struct lmb_region *rgn, phys_addr_t base,
+static long lmb_overlaps_region(struct lmb_region *rgn, phys_addr_t base,
phys_size_t size)
{
unsigned long i;
diff --git a/lib/time.c b/lib/time.c
index 5ebd1be48f..477440de16 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -37,7 +37,7 @@ unsigned long notrace timer_read_counter(void)
extern unsigned long __weak timer_read_counter(void);
#endif
-unsigned long long __weak notrace get_ticks(void)
+uint64_t __weak notrace get_ticks(void)
{
unsigned long now = timer_read_counter();
@@ -45,11 +45,11 @@ unsigned long long __weak notrace get_ticks(void)
if (now < gd->timebase_l)
gd->timebase_h++;
gd->timebase_l = now;
- return ((unsigned long long)gd->timebase_h << 32) | gd->timebase_l;
+ return ((uint64_t)gd->timebase_h << 32) | gd->timebase_l;
}
/* Returns time in milliseconds */
-static unsigned long long notrace tick_to_time(unsigned long long tick)
+static uint64_t notrace tick_to_time(uint64_t tick)
{
ulong div = get_tbclk();
@@ -74,9 +74,9 @@ unsigned long __weak notrace timer_get_us(void)
return tick_to_time(get_ticks() * 1000);
}
-static unsigned long long usec_to_tick(unsigned long usec)
+static uint64_t usec_to_tick(unsigned long usec)
{
- unsigned long long tick = usec;
+ uint64_t tick = usec;
tick *= get_tbclk();
do_div(tick, 1000000);
return tick;
@@ -84,7 +84,7 @@ static unsigned long long usec_to_tick(unsigned long usec)
void __weak __udelay(unsigned long usec)
{
- unsigned long long tmp;
+ uint64_t tmp;
tmp = get_ticks() + usec_to_tick(usec); /* get current timestamp */
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 7ec758e40f..b585713b7c 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -270,7 +270,7 @@ static char *put_dec_full(char *buf, unsigned q)
return buf;
}
/* No inlining helps gcc to use registers better */
-static noinline char *put_dec(char *buf, u64 num)
+static noinline char *put_dec(char *buf, uint64_t num)
{
while (1) {
unsigned rem;
OpenPOWER on IntegriCloud