Patchwork [U-Boot,03/32] sandbox: Use uint64_t instead of u64 for time

login
register
mail settings
Submitter Simon Glass
Date Nov. 10, 2013, 5:26 p.m.
Message ID <1384104439-27026-4-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/290073/
State Superseded, archived
Delegated to: Simon Glass
Headers show

Comments

Simon Glass - Nov. 10, 2013, 5:26 p.m.
The uint64_t type is defined in linux/types.h, so is safer than u64, which
is not actually a Linux type.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/sandbox/cpu/os.c | 3 ++-
 include/os.h          | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index c4bdbb0..26f44cb 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -8,6 +8,7 @@ 
 #include <fcntl.h>
 #include <getopt.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <termios.h>
@@ -136,7 +137,7 @@  void os_usleep(unsigned long usec)
 	usleep(usec);
 }
 
-u64 __attribute__((no_instrument_function)) os_get_nsec(void)
+uint64_t __attribute__((no_instrument_function)) os_get_nsec(void)
 {
 #if defined(CLOCK_MONOTONIC) && defined(_POSIX_MONOTONIC_CLOCK)
 	struct timespec tp;
diff --git a/include/os.h b/include/os.h
index 8665f70..950433d 100644
--- a/include/os.h
+++ b/include/os.h
@@ -11,6 +11,8 @@ 
 #ifndef __OS_H__
 #define __OS_H__
 
+#include <linux/types.h>
+
 struct sandbox_state;
 
 /**
@@ -116,7 +118,7 @@  void os_usleep(unsigned long usec);
  *
  * \return A monotonic increasing time scaled in nano seconds
  */
-u64 os_get_nsec(void);
+uint64_t os_get_nsec(void);
 
 /**
  * Parse arguments and update sandbox state.