diff options
author | Rakesh Sharma <rasharma@nvidia.com> | 2013-12-30 21:27:30 +0530 |
---|---|---|
committer | Mitch Luban <mluban@nvidia.com> | 2014-01-23 17:27:56 -0800 |
commit | 4117971dc19c8d0e2d2de5db4a641897cb86f4aa (patch) | |
tree | f381cbe2c2ab6bc3ae8afde1337fb2ac98c4f862 /drivers | |
parent | 7c9b1dfbb34ccda061ef9e97a2e5a9beb187ba23 (diff) |
media: platform: tegra: Do 8 byte alignment
* Make structures 8 byte aligned.
* Remove pointers
* user _IOC_NR for ioctl
Bug 1408557
Change-Id: I7b4d53f0d7316dd5abe2b9546fe34c8ba45295f2
Signed-off-by: Rakesh Sharma <rasharma@nvidia.com>
Reviewed-on: http://git-master/r/350665
(cherry picked from commit f93bd46c9c7630da77dfd30d93ee836464f03582)
Signed-off-by: Rakesh Sharma <rasharma@nvidia.com>
Reviewed-on: http://git-master/r/358025
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/platform/tegra/cam_dev/virtual.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/media/platform/tegra/cam_dev/virtual.c b/drivers/media/platform/tegra/cam_dev/virtual.c index 2f239fa46e4d..dbff3037160f 100644 --- a/drivers/media/platform/tegra/cam_dev/virtual.c +++ b/drivers/media/platform/tegra/cam_dev/virtual.c @@ -84,7 +84,8 @@ static int virtual_update( } memset(&ec, 0, sizeof(ec)); if (copy_from_user(&ec, - (const void __user *)upd[idx].arg, + ((const void __user *) + (unsigned long)upd[idx].arg), sizeof(ec))) { dev_err(cdev->dev, "%s copy_from_user err line %d\n", @@ -127,7 +128,8 @@ static int virtual_update( memset(buf, 0, sizeof(buf)); if (copy_from_user(buf, - (const void __user *)upd[idx].arg, + ((const void __user *) + (unsigned long)upd[idx].arg), sizeof(buf) - 1 < upd[idx].size ? sizeof(buf) - 1 : upd[idx].size)) { dev_err(cdev->dev, @@ -161,13 +163,13 @@ static int virtual_update( } if (upd[idx].arg >= cdev->pinmux_num) { dev_err(cdev->dev, - "pinmux index %lu out of range.\n", + "pinmux index %u out of range.\n", upd[idx].arg); err = -ENODEV; break; } - dev_dbg(cdev->dev, "UPDATE_PINMUX: %d %lu\n", + dev_dbg(cdev->dev, "UPDATE_PINMUX: %d %u\n", upd[idx].index, upd[idx].arg); if (!upd[idx].index) pinmux = &cdev->mclk_enable_idx; @@ -187,7 +189,7 @@ static int virtual_update( err = -ENODEV; break; } - gpio = (void *)upd[idx].arg; + gpio = (void *)((unsigned long)upd[idx].arg); if (gpio->gpio >= ARCH_NR_GPIOS) { dev_err(cdev->dev, "gpio index %d out of range.\n", @@ -196,7 +198,7 @@ static int virtual_update( break; } - dev_dbg(cdev->dev, "UPDATE_GPIO: %d %lu\n", + dev_dbg(cdev->dev, "UPDATE_GPIO: %d %u\n", upd[idx].index, upd[idx].arg); gpio->valid = true; cdev->gpios[upd[idx].index] = *gpio; @@ -454,7 +456,8 @@ static int virtual_chip_config( c_info->seq_power_on = (void *)rptr; if (copy_from_user( - c_info->seq_power_on, (const void __user *)dev_info->power_on, + c_info->seq_power_on, + (const void __user *)(unsigned long)dev_info->power_on, sizeof(struct camera_reg) * dev_info->pwr_on_size)) { dev_err(dev, "%s copy_from_user err line %d\n", __func__, __LINE__); @@ -464,7 +467,8 @@ static int virtual_chip_config( c_info->seq_power_off = (void *)c_info->seq_power_on + sizeof(struct camera_reg) * dev_info->pwr_on_size; if (copy_from_user( - c_info->seq_power_off, (const void __user *)dev_info->power_off, + c_info->seq_power_off, + (const void __user *)(unsigned long)dev_info->power_off, sizeof(struct camera_reg) * dev_info->pwr_off_size)) { dev_err(dev, "%s copy_from_user err line %d\n", __func__, __LINE__); |