diff options
author | Vitaliy Shevtsov <v.shevtsov@mt-integration.ru> | 2025-03-05 18:11:25 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2025-03-06 19:28:25 +0300 |
commit | c0c1a6bf80e9075e3f6b81fd542550d8eb91e57a (patch) | |
tree | 292b5f356ff6ba4c9ec03f08321c2f6a6407feda /scripts/generate_rust_analyzer.py | |
parent | e49563c3be09d4639ccff8ca68ef63b6f6c8456d (diff) | |
download | linux-c0c1a6bf80e9075e3f6b81fd542550d8eb91e57a.tar.xz |
media: cec: use us_to_ktime() where appropriate
[Why]
There are several ns_to_ktime() calls that require using nanoseconds. It is
better to replace them with us_to_ktime() to make code clear, getting rid
of multiplication by 1000.
Also the timer function code may have an integer wrap-around issue. Since
both tx_custom_low_usecs and tx_custom_high_usecs can be set to up to
9999999 from the user space via cec_pin_error_inj_parse_line(), this may
cause usecs to be overflowed when adap->monitor_pin_cnt is zero and usecs
is multiplied by 1000.
[How]
Take advantage of using an appropriate helper func us_to_ktime() instead of
ns_to_ktime() to improve readability and to make the code clearer. And this
also mitigates possible integer wrap-arounds when usecs value is too large
and it is multiplied by 1000.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Signed-off-by: Vitaliy Shevtsov <v.shevtsov@mt-integration.ru>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions