media: atomisp: use clamp() in ia_css_eed1_8_encode()

When it needs to get a value within a certain interval, using clamp()
makes the code easier to understand than min(max()).

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20240830011752.603433-2-lizetao1@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Li Zetao 2024-08-30 03:17:51 +02:00 committed by Mauro Carvalho Chehab
parent 7483ce8fc7
commit 7adc719353

View File

@ -276,7 +276,7 @@ ia_css_eed1_8_encode(
for (i = 0; i < (IA_CSS_NUMBER_OF_DEW_ENHANCE_SEGMENTS - 1); i++) {
min_exp = max(min_exp, from->dew_enhance_seg_exp[i]);
}
to->e_dew_enh_asr = 13 - min(max(min_exp, 0), 13);
to->e_dew_enh_asr = 13 - clamp(min_exp, 0, 13);
to->dedgew_max = from->dedgew_max;
}