summaryrefslogtreecommitdiffstats
path: root/drivers/staging/android
diff options
context:
space:
mode:
authorTapasweni Pathak <tapaswenipathak@gmail.com>2014-10-26 19:20:16 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-28 16:15:03 +0800
commit353fdf17060b15d1d857899cd3ed9d5db4818acf (patch)
treec8761607b1ae06b0c3bb7e38bd8879a58f1dc19d /drivers/staging/android
parentac611dc60fc0cc050344861668f916c191f4b6cd (diff)
downloadlinux-stable-353fdf17060b15d1d857899cd3ed9d5db4818acf.tar.gz
linux-stable-353fdf17060b15d1d857899cd3ed9d5db4818acf.tar.bz2
linux-stable-353fdf17060b15d1d857899cd3ed9d5db4818acf.zip
staging: android: Replace timeval with timespec64
'timeval' is used to print timestamps in seconds and millisecond. 32-bit systems using 'struct timeval' will break in the year 2038, So we have to replace that code with more appropriate types. This patch changes the android driver to use timespec64. Since this is a staging driver and the output is only used for a debugfs file, it is fine to slightly change the output and use nanoseconds instead. ktime_to_timespec64, is used which will return seconds and nanoseconds. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android')
-rw-r--r--drivers/staging/android/sync_debug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c
index 257fc91bf02b..1532a86404be 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/staging/android/sync_debug.c
@@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/anon_inodes.h>
+#include <linux/time64.h>
#include "sync.h"
#ifdef CONFIG_DEBUG_FS
@@ -95,9 +96,9 @@ static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence)
sync_status_str(status));
if (status <= 0) {
- struct timeval tv = ktime_to_timeval(pt->base.timestamp);
+ struct timespec64 ts64 = ktime_to_timespec64(pt->base.timestamp);
- seq_printf(s, "@%ld.%06ld", tv.tv_sec, tv.tv_usec);
+ seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
}
if (parent->ops->timeline_value_str &&