Skip to content

Commit 45fbce1

Browse files
ribaldamchehab
authored andcommitted
media: gspca: cpia1: Use min macro
Simplifies the code. Found by cocci: drivers/media/usb/gspca/cpia1.c:607:30-31: WARNING opportunity for min() Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 4801655 commit 45fbce1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/media/usb/gspca/cpia1.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,8 @@ static int find_over_exposure(int brightness)
604604
MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - brightness -
605605
FLICKER_BRIGHTNESS_CONSTANT;
606606

607-
if (MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE)
608-
OverExposure = MaxAllowableOverExposure;
609-
else
610-
OverExposure = FLICKER_ALLOWABLE_OVER_EXPOSURE;
607+
OverExposure = min(MaxAllowableOverExposure,
608+
FLICKER_ALLOWABLE_OVER_EXPOSURE);
611609

612610
return OverExposure;
613611
}

0 commit comments

Comments
 (0)