aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-03-09 20:17:02 +0100
committerArnd Bergmann <arnd@arndb.de>2011-03-09 20:17:02 +0100
commit46c501db9708543d07fc9741ff1d6b12aa8ad9a2 (patch)
treeeda66b3802bd4c6d0db10b28c30e2861f0f58358
parentee2ef6ff0f29bea0aac60663812c67df59b421e7 (diff)
flashbench: fix time_to_ns for 32 bit systems
Incorrect type conversion results in potentially negative time values. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dev.c b/dev.c
index b9468ce..f1718be 100644
--- a/dev.c
+++ b/dev.c
@@ -26,7 +26,7 @@
static inline long long time_to_ns(struct timespec *ts)
{
- return ts->tv_sec * 1000 * 1000 * 1000 + ts->tv_nsec;
+ return (long long)ts->tv_sec * 1000 * 1000 * 1000 + ts->tv_nsec;
}
static long long get_ns(void)