diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-11-27 18:25:56 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-08 19:26:24 +0300 |
commit | aad2fa4c8b1d99a737f97b031cc3e262f158b02e (patch) | |
tree | b82e5566477b2c7af406f43dbe7654c4391415c5 /drivers/media/platform/vivid/vivid-rds-gen.h | |
parent | 1d88f4bccfd87b6359f11032f2018893d531d18d (diff) | |
download | linux-aad2fa4c8b1d99a737f97b031cc3e262f158b02e.tar.xz |
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>
Diffstat (limited to 'drivers/media/platform/vivid/vivid-rds-gen.h')
-rw-r--r-- | drivers/media/platform/vivid/vivid-rds-gen.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/platform/vivid/vivid-rds-gen.h b/drivers/media/platform/vivid/vivid-rds-gen.h index eff4bf552ed3..e55e3b22b7ca 100644 --- a/drivers/media/platform/vivid/vivid-rds-gen.h +++ b/drivers/media/platform/vivid/vivid-rds-gen.h @@ -29,6 +29,7 @@ #define VIVID_RDS_GEN_GROUPS 57 #define VIVID_RDS_GEN_BLKS_PER_GRP 4 #define VIVID_RDS_GEN_BLOCKS (VIVID_RDS_GEN_BLKS_PER_GRP * VIVID_RDS_GEN_GROUPS) +#define VIVID_RDS_NSEC_PER_BLK (u32)(5ull * NSEC_PER_SEC / VIVID_RDS_GEN_BLOCKS) struct vivid_rds_gen { struct v4l2_rds_data data[VIVID_RDS_GEN_BLOCKS]; |