[media] Fix 64-bit division fall-out from 64-bit control ranges
authorHans Verkuil <hverkuil@xs4all.nl>
Thu, 17 Jul 2014 15:31:23 +0000 (12:31 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 17 Jul 2014 15:44:38 +0000 (12:44 -0300)
commit0d5e8c4313c83dc2d60519a219d517a13ba8a432
tree5a9f6581e1cc493f7dc624e51e7b65598a419005
parent028e2b4fb69f03a294a69b27c99f05002b8ac021
[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>
drivers/media/i2c/soc_camera/mt9m001.c
drivers/media/i2c/soc_camera/mt9t031.c
drivers/media/i2c/soc_camera/mt9v022.c
drivers/media/radio/radio-keene.c
drivers/media/usb/gspca/autogain_functions.c
drivers/media/usb/gspca/pac7302.c
drivers/media/usb/gspca/sonixb.c
drivers/media/v4l2-core/v4l2-ctrls.c