aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-keene.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2014-07-17 11:31:23 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-17 11:44:38 -0400
commit0d5e8c4313c83dc2d60519a219d517a13ba8a432 (patch)
tree5a9f6581e1cc493f7dc624e51e7b65598a419005 /drivers/media/radio/radio-keene.c
parent028e2b4fb69f03a294a69b27c99f05002b8ac021 (diff)
[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/radio/radio-keene.c')
-rw-r--r--drivers/media/radio/radio-keene.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index 67ac72e66850..0c5d2db3b828 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -265,7 +265,7 @@ static int keene_s_ctrl(struct v4l2_ctrl *ctrl)
265 return keene_cmd_set(radio); 265 return keene_cmd_set(radio);
266 266
267 case V4L2_CID_AUDIO_COMPRESSION_GAIN: 267 case V4L2_CID_AUDIO_COMPRESSION_GAIN:
268 radio->tx = db2tx[(ctrl->val - ctrl->minimum) / ctrl->step]; 268 radio->tx = db2tx[(ctrl->val - (s32)ctrl->minimum) / (s32)ctrl->step];
269 return keene_cmd_set(radio); 269 return keene_cmd_set(radio);
270 } 270 }
271 return -EINVAL; 271 return -EINVAL;