Re: [PATCH 6/8] [media] vivid: use ktime_t for timestamp calculation

From: Arnd Bergmann
Date: Mon Nov 27 2017 - 10:25:54 EST


On Mon, Nov 27, 2017 at 4:14 PM, Hans Verkuil <hverkuil@xxxxxxxxx> wrote:

>> - ktime_get_ts(&ts);
>> - use_alternates = ts.tv_sec % 10 >= 5;
>> + timestamp = ktime_sub(ktime_get(), dev->radio_rds_init_time);
>> + blk = ktime_divns(timestamp, VIVID_RDS_NSEC_PER_BLK);
>> + use_alternates = blk % VIVID_RDS_GEN_BLOCKS;
>> +
>
> Almost right. This last line should be:
>
> use_alternates = (blk / VIVID_RDS_GEN_BLOCKS) & 1;
>
> With that in place it works and you can add my:
>
> Tested-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>

Makes sense. Sending a fixed version now, thanks a lot for testing!

Arnd