[media] Fix 64-bit division fall-out from 64-bit control ranges
Commit 0ba2aeb6da
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>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
028e2b4fb6
commit
0d5e8c4313
@@ -121,9 +121,9 @@ int gspca_coarse_grained_expo_autogain(
|
||||
orig_gain = gain = v4l2_ctrl_g_ctrl(gspca_dev->gain);
|
||||
orig_exposure = exposure = v4l2_ctrl_g_ctrl(gspca_dev->exposure);
|
||||
|
||||
gain_low = (gspca_dev->gain->maximum - gspca_dev->gain->minimum) /
|
||||
gain_low = (s32)(gspca_dev->gain->maximum - gspca_dev->gain->minimum) /
|
||||
5 * 2 + gspca_dev->gain->minimum;
|
||||
gain_high = (gspca_dev->gain->maximum - gspca_dev->gain->minimum) /
|
||||
gain_high = (s32)(gspca_dev->gain->maximum - gspca_dev->gain->minimum) /
|
||||
5 * 4 + gspca_dev->gain->minimum;
|
||||
|
||||
/* If we are of a multiple of deadzone, do multiple steps to reach the
|
||||
|
Reference in New Issue
Block a user