]> git.baikalelectronics.ru Git - kernel.git/commit
media: vivid: use ktime_t for timestamp calculation
authorArnd Bergmann <arnd@arndb.de>
Mon, 27 Nov 2017 15:25:56 +0000 (10:25 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Dec 2017 16:26:24 +0000 (11:26 -0500)
commit7f8adefc241119ea2daf3b3bb6f92ac6b8c3ce13
treeb82e5566477b2c7af406f43dbe7654c4391415c5
parentb9d4c304ac7c3447dc7d773db8a430c57c239bd9
media: vivid: use ktime_t for timestamp calculation

timespec is generally deprecated because of the y2038 overflow.
In vivid, the usage is fine, since we are dealing with monotonic
timestamps, but we can also simplify the code by going to ktime_t.

Using ktime_divns() should be roughly as efficient as the old code,
since the constant 64-bit division gets turned into a multiplication
on modern platforms, and we save multiple 32-bit divisions that can be
expensive e.g. on ARMv7.

Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vivid/vivid-core.c
drivers/media/platform/vivid/vivid-core.h
drivers/media/platform/vivid/vivid-radio-rx.c
drivers/media/platform/vivid/vivid-radio-tx.c
drivers/media/platform/vivid/vivid-rds-gen.h