fimc-is2: fix sizeof pointer use
authorStricted <info@stricted.net>
Sun, 3 May 2020 04:33:51 +0000 (04:33 +0000)
committerStricted <info@stricted.net>
Fri, 21 Jan 2022 17:22:00 +0000 (17:22 +0000)
Change-Id: Ie53e42ab4527647e4435449b738a6b869508160f

drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-5e9.c
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-gm1sp.c

index c1779b125e2a479b268d1a6137ebac08de2da9e6..10fa15637a57da7c0e227cd5a8812f34f988422a 100644 (file)
@@ -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__);
index 6ed526f4534570d64887864100abd68dc92410f3..9f3aa79d74ea708fc6e5431c1d0407c209243e2a 100755 (executable)
@@ -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__);
index 14d3fc2639232ddaa028e181d8ee51eedf30399e..70adfff9857694da2a6bc913fc3e404d11827449 100644 (file)
@@ -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__);