diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-11-10 19:46:17 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-08 19:13:16 +0300 |
commit | 41e33085284dd2bc6b6180d8381ff8a509b9d8ba (patch) | |
tree | 3f70a95249406906351c0e0b7c6febde94665dc8 /drivers/media/platform/vivid/vivid-vbi-gen.c | |
parent | d5ac225c7d64c9c3ef821239edc035634e594ec9 (diff) | |
download | linux-41e33085284dd2bc6b6180d8381ff8a509b9d8ba.tar.xz |
media: vivid: print time in y2038-safe way
time_to_tm() takes a time_t value that overflows in 2038 on 32-bit
systems. time64_to_tm() doesn't have this problem, so let's use that in
combination with ktime_get_real_seconds() to read a 64-bit time
value.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vivid/vivid-vbi-gen.c')
-rw-r--r-- | drivers/media/platform/vivid/vivid-vbi-gen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/vivid/vivid-vbi-gen.c b/drivers/media/platform/vivid/vivid-vbi-gen.c index a2159de83d0b..02c79d7cedab 100644 --- a/drivers/media/platform/vivid/vivid-vbi-gen.c +++ b/drivers/media/platform/vivid/vivid-vbi-gen.c @@ -190,7 +190,7 @@ static void vivid_vbi_gen_set_time_of_day(u8 *packet) struct tm tm; u8 checksum, i; - time_to_tm(get_seconds(), 0, &tm); + time64_to_tm(ktime_get_real_seconds(), 0, &tm); packet[0] = calc_parity(0x07); packet[1] = calc_parity(0x01); packet[2] = calc_parity(0x40 | tm.tm_min); |