summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2024-04-29 17:04:57 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2024-05-03 12:13:45 +0200
commit45fbce19e789ce663e9685baacc3d0574721c9cd (patch)
tree122cc63f3794bb8b76b5ae6a6ddca665c9f83004 /drivers/media
parentmedia: flexcop-usb: Use min macro (diff)
downloadlinux-45fbce19e789ce663e9685baacc3d0574721c9cd.tar.xz
linux-45fbce19e789ce663e9685baacc3d0574721c9cd.zip
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/20240429-fix-cocci-v3-18-3c4865f5a4b0@chromium.org Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/gspca/cpia1.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c
index 5f5fa851ca64..14aaf36cde6e 100644
--- a/drivers/media/usb/gspca/cpia1.c
+++ b/drivers/media/usb/gspca/cpia1.c
@@ -604,10 +604,8 @@ static int find_over_exposure(int brightness)
MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - brightness -
FLICKER_BRIGHTNESS_CONSTANT;
- if (MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE)
- OverExposure = MaxAllowableOverExposure;
- else
- OverExposure = FLICKER_ALLOWABLE_OVER_EXPOSURE;
+ OverExposure = min(MaxAllowableOverExposure,
+ FLICKER_ALLOWABLE_OVER_EXPOSURE);
return OverExposure;
}