]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: av7110: avoid 2038 overflow in debug print
authorArnd Bergmann <arnd@arndb.de>
Mon, 6 Nov 2017 14:06:50 +0000 (09:06 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 7 Nov 2017 08:11:02 +0000 (03:11 -0500)
Using the deprecated do_gettimeofday() in print_time() will overflow
in 2038 on 32-bit architectures. It'sbetter to use a structure that
is safe everywhere. While we're at it, fix the missing leading zeroes
on the sub-second portion.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/ttpci/av7110.c

index f89fb23f6c57887eea6482059c4bba27fa1c0337..6d415bdeef1877e274cf4f803370afa2d4779732 100644 (file)
@@ -347,9 +347,9 @@ static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len,
 static inline void print_time(char *s)
 {
 #ifdef DEBUG_TIMING
-       struct timeval tv;
-       do_gettimeofday(&tv);
-       printk("%s: %d.%d\n", s, (int)tv.tv_sec, (int)tv.tv_usec);
+       struct timespec64 ts;
+       ktime_get_real_ts64(&ts);
+       printk("%s: %lld.%09ld\n", s, (s64)ts.tv_sec, ts.tv_nsec);
 #endif
 }