diff options
author | Deepak R Varma <drv@mailo.com> | 2022-11-07 19:11:21 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-11-25 07:32:49 +0000 |
commit | 645e71337e1c31795f48f18dd62202a001101a85 (patch) | |
tree | 75c4a23a0bbfa1486636edcae58e9d6e6d3063b0 /drivers/staging/media/meson | |
parent | 0c078e310b6d16b9b9489bbc7bc1476430d19a7c (diff) | |
download | linux-stable-645e71337e1c31795f48f18dd62202a001101a85.tar.gz linux-stable-645e71337e1c31795f48f18dd62202a001101a85.tar.bz2 linux-stable-645e71337e1c31795f48f18dd62202a001101a85.zip |
media: staging: media: meson: vdec: use min() for comparison and assignment
Use of standard min() helper macro is preferred over using ternary
operator for logical evaluation and value assignment. This issue is
identified by coccicheck using the minmax.cocci file.
Signed-off-by: Deepak R Varma <drv@mailo.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/meson')
-rw-r--r-- | drivers/staging/media/meson/vdec/codec_vp9.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/media/meson/vdec/codec_vp9.c b/drivers/staging/media/meson/vdec/codec_vp9.c index cf0f58d982c8..394df5761556 100644 --- a/drivers/staging/media/meson/vdec/codec_vp9.c +++ b/drivers/staging/media/meson/vdec/codec_vp9.c @@ -1459,7 +1459,7 @@ static void vp9_tree_merge_probs(unsigned int *prev_prob, if (den == 0) { new_prob = pre_prob; } else { - m_count = den < MODE_MV_COUNT_SAT ? den : MODE_MV_COUNT_SAT; + m_count = min(den, MODE_MV_COUNT_SAT); get_prob = clip_prob(div_r32(((int64_t)tree_left * 256 + (den >> 1)), @@ -1513,7 +1513,7 @@ static void adapt_coef_probs_cxt(unsigned int *prev_prob, /* get binary prob */ num = branch_ct[node][0]; den = branch_ct[node][0] + branch_ct[node][1]; - m_count = den < count_sat ? den : count_sat; + m_count = min(den, count_sat); get_prob = (den == 0) ? 128u : @@ -1663,8 +1663,7 @@ static void adapt_coef_probs(int prev_kf, int cur_kf, int pre_fc, if (den == 0) { new_prob = pre_prob; } else { - m_count = den < MODE_MV_COUNT_SAT ? - den : MODE_MV_COUNT_SAT; + m_count = min(den, MODE_MV_COUNT_SAT); get_prob = clip_prob(div_r32(((int64_t) count[coef_count_node_start] * 256 + |