Skip to content

Commit 7adc719

Browse files
Li Zetaomchehab
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 7483ce8 commit 7adc719

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/media/atomisp/pci/isp/kernels/eed1_8/ia_css_eed1_8.host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ ia_css_eed1_8_encode(
276276
for (i = 0; i < (IA_CSS_NUMBER_OF_DEW_ENHANCE_SEGMENTS - 1); i++) {
277277
min_exp = max(min_exp, from->dew_enhance_seg_exp[i]);
278278
}
279-
to->e_dew_enh_asr = 13 - min(max(min_exp, 0), 13);
279+
to->e_dew_enh_asr = 13 - clamp(min_exp, 0, 13);
280280

281281
to->dedgew_max = from->dedgew_max;
282282
}

0 commit comments

Comments
 (0)