From cb433c226151aafd2d23619d470a750774ff8043 Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 3 May 2020 04:33:51 +0000 Subject: [PATCH] fimc-is2: fix sizeof pointer use Change-Id: Ie53e42ab4527647e4435449b738a6b869508160f --- .../fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c | 4 +++- .../fimc-is2/sensor/module_framework/cis/fimc-is-cis-5e9.c | 4 +++- .../fimc-is2/sensor/module_framework/cis/fimc-is-cis-gm1sp.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c index c1779b125e2a..10fa15637a57 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c @@ -57,6 +57,7 @@ static const struct sensor_pll_info_compact **sensor_2x5sp_pllinfos; static u32 sensor_2x5sp_max_setfile_num; static const u32 *sensor_2x5sp_setfile_throttling; +static u32 sensor_2x5sp_setfile_throttling_size; static const struct sensor_pll_info_compact *sensor_2x5sp_pllinfo_throttling; static void sensor_2x5sp_cis_data_calculation(const struct sensor_pll_info_compact *pll_info_compact, cis_shared_data *cis_data) @@ -727,7 +728,7 @@ int sensor_2x5sp_cis_mode_change_throttling(struct v4l2_subdev *subdev) I2C_MUTEX_LOCK(cis->i2c_lock); ret = sensor_cis_set_registers(subdev, sensor_2x5sp_setfile_throttling, - sizeof(sensor_2x5sp_setfile_throttling) / sizeof(sensor_2x5sp_setfile_throttling[0])); + sensor_2x5sp_setfile_throttling_size); if (ret < 0) { err("sensor_gm1sp_set_registers fail!!"); goto p_err; @@ -2502,6 +2503,7 @@ static int cis_2x5sp_probe(struct i2c_client *client, /* throttling setting */ sensor_2x5sp_setfile_throttling = sensor_2x5sp_setfile_B_2880x2160_15fps; + sensor_2x5sp_setfile_throttling_size = ARRAY_SIZE(sensor_2x5sp_setfile_B_2880x2160_15fps); sensor_2x5sp_pllinfo_throttling = &sensor_2x5sp_pllinfo_B_2880x2160_15fps; } else { err("%s setfile index out of bound, take default (setfile_A)", __func__); diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-5e9.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-5e9.c index 6ed526f45345..9f3aa79d74ea 100755 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-5e9.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-5e9.c @@ -56,6 +56,7 @@ static const struct sensor_pll_info **sensor_5e9_pllinfos; static u32 sensor_5e9_max_setfile_num; static const u32 *sensor_5e9_setfile_throttling; +static u32 sensor_5e9_setfile_throttlingl_size; static const struct sensor_pll_info *sensor_5e9_pllinfo_throttling; static void sensor_5e9_cis_data_calculation(const struct sensor_pll_info *pll_info, cis_shared_data *cis_data) @@ -901,7 +902,7 @@ int sensor_5e9_cis_mode_change_throttling(struct v4l2_subdev *subdev) I2C_MUTEX_LOCK(cis->i2c_lock); ret = sensor_cis_set_registers(subdev, sensor_5e9_setfile_throttling, - sizeof(sensor_5e9_setfile_throttling) / sizeof(sensor_5e9_setfile_throttling[0])); + sensor_5e9_setfile_throttlingl_size); if (ret < 0) { err("sensor_gm1sp_set_registers fail!!"); goto p_err; @@ -2423,6 +2424,7 @@ static int cis_5e9_probe(struct i2c_client *client, /* throttling setting */ sensor_5e9_setfile_throttling = sensor_5e9_setfile_C_2592x1944_15fps; + sensor_5e9_setfile_throttlingl_size = ARRAY_SIZE(sensor_5e9_setfile_C_2592x1944_15fps); sensor_5e9_pllinfo_throttling = &sensor_5e9_pllinfo_C_2592x1944_15fps; } else { err("%s setfile index out of bound, take default (setfile_A)", __func__); diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-gm1sp.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-gm1sp.c index 14d3fc263923..70adfff98576 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-gm1sp.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-gm1sp.c @@ -55,6 +55,7 @@ static const struct sensor_pll_info_compact **sensor_gm1sp_pllinfos; static u32 sensor_gm1sp_max_setfile_num; static const u32 *sensor_gm1sp_setfile_throttling; +static u32 sensor_gm1sp_setfile_throttling_size; static const struct sensor_pll_info_compact *sensor_gm1sp_pllinfo_throttling; static void sensor_gm1sp_cis_data_calculation(const struct sensor_pll_info_compact *pll_info_compact, cis_shared_data *cis_data) @@ -415,7 +416,7 @@ int sensor_gm1sp_cis_mode_change_throttling(struct v4l2_subdev *subdev) I2C_MUTEX_LOCK(cis->i2c_lock); ret = sensor_cis_set_registers(subdev, sensor_gm1sp_setfile_throttling, - sizeof(sensor_gm1sp_setfile_throttling) / sizeof(sensor_gm1sp_setfile_throttling[0])); + sensor_gm1sp_setfile_throttling_size); if (ret < 0) { err("sensor_gm1sp_set_registers fail!!"); goto p_err; @@ -1799,6 +1800,7 @@ static int cis_gm1sp_probe(struct i2c_client *client, /* throttling setting */ sensor_gm1sp_setfile_throttling = sensor_gm1sp_setfile_B_4000x3000_15fps; + sensor_gm1sp_setfile_throttling_size = ARRAY_SIZE(sensor_gm1sp_setfile_B_4000x3000_15fps); sensor_gm1sp_pllinfo_throttling = &sensor_gm1sp_pllinfo_B_4000x3000_15fps; } else { err("%s setfile index out of bound, take default (setfile_A)", __func__); -- 2.20.1