summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/gspca/sonixb.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2014-07-17 12:31:23 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-17 12:44:38 -0300
commit0d5e8c4313c83dc2d60519a219d517a13ba8a432 (patch)
tree5a9f6581e1cc493f7dc624e51e7b65598a419005 /drivers/media/usb/gspca/sonixb.c
parent028e2b4fb69f03a294a69b27c99f05002b8ac021 (diff)
downloadlinux-0d5e8c4313c83dc2d60519a219d517a13ba8a432.tar.gz
linux-0d5e8c4313c83dc2d60519a219d517a13ba8a432.tar.bz2
linux-0d5e8c4313c83dc2d60519a219d517a13ba8a432.zip
[media] Fix 64-bit division fall-out from 64-bit control ranges
Commit 0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3 increased the internal control ranges to 64 bit, but that caused problems in drivers that use the minimum/maximum/step/default_value control values in a division or modulus operations since not all architectures support those natively. Luckily, in almost all cases it is possible to just cast to 32 bits (the control value is known to be 32 bits, so it is safe to cast). Only in v4l2-ctrls.c was it necessary to use do_div in one function. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/gspca/sonixb.c')
-rw-r--r--drivers/media/usb/gspca/sonixb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/gspca/sonixb.c b/drivers/media/usb/gspca/sonixb.c
index ecbcb39feb71..6696b2ec34e9 100644
--- a/drivers/media/usb/gspca/sonixb.c
+++ b/drivers/media/usb/gspca/sonixb.c
@@ -913,7 +913,7 @@ static void do_autogain(struct gspca_dev *gspca_dev)
desired_avg_lum, deadzone))
sd->autogain_ignore_frames = AUTOGAIN_IGNORE_FRAMES;
} else {
- int gain_knee = gspca_dev->gain->maximum * 9 / 10;
+ int gain_knee = (s32)gspca_dev->gain->maximum * 9 / 10;
if (gspca_expo_autogain(gspca_dev, avg_lum, desired_avg_lum,
deadzone, gain_knee, sd->exposure_knee))
sd->autogain_ignore_frames = AUTOGAIN_IGNORE_FRAMES;