From 706a6cfac24399b3e3d03598bbd5d47a03050d9c Mon Sep 17 00:00:00 2001 From: Eunyoung Lee Date: Fri, 6 Jul 2018 09:37:01 +0900 Subject: [PATCH] [COMMON] fimc-is2: code cleanup - cis-2p6 files PR JIRA ID : CPR-38 Change-Id: I54fad60aa9ee3a641e3d255bfed01b8a123e9334 Signed-off-by: Eunyoung Lee --- .../cis/fimc-is-cis-2p6-setA.h | 18 +++++++++--------- .../cis/fimc-is-cis-2p6-setB.h | 18 +++++++++--------- .../module_framework/cis/fimc-is-cis-2p6.c | 12 ++++++------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setA.h b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setA.h index 35a2824b337c..05ac60c6ee53 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setA.h +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setA.h @@ -500,15 +500,15 @@ static const u32 *sensor_2p6_setfiles_A[] = { static const u32 sensor_2p6_setfile_A_sizes[] = { /* 16x12 margin */ - sizeof(sensor_2p6_setfile_A_4608x3456_30fps) / sizeof(sensor_2p6_setfile_A_4608x3456_30fps[0]), - sizeof(sensor_2p6_setfile_A_4608x2624_30fps) / sizeof(sensor_2p6_setfile_A_4608x2624_30fps[0]), - sizeof(sensor_2p6_setfile_A_4608x2240_30fps) / sizeof(sensor_2p6_setfile_A_4608x2240_30fps[0]), - sizeof(sensor_2p6_setfile_A_2304x1728_30fps) / sizeof(sensor_2p6_setfile_A_2304x1728_30fps[0]), - sizeof(sensor_2p6_setfile_A_2304x1728_15fps) / sizeof(sensor_2p6_setfile_A_2304x1728_15fps[0]), - sizeof(sensor_2p6_setfile_A_2304x1312_30fps) / sizeof(sensor_2p6_setfile_A_2304x1312_30fps[0]), - sizeof(sensor_2p6_setfile_A_2304x1120_30fps) / sizeof(sensor_2p6_setfile_A_2304x1120_30fps[0]), - sizeof(sensor_2p6_setfile_A_1152x864_120fps) / sizeof(sensor_2p6_setfile_A_1152x864_120fps[0]), - sizeof(sensor_2p6_setfile_A_1152x656_120fps) / sizeof(sensor_2p6_setfile_A_1152x656_120fps[0]), + ARRAY_SIZE(sensor_2p6_setfile_A_4608x3456_30fps), + ARRAY_SIZE(sensor_2p6_setfile_A_4608x2624_30fps), + ARRAY_SIZE(sensor_2p6_setfile_A_4608x2240_30fps), + ARRAY_SIZE(sensor_2p6_setfile_A_2304x1728_30fps), + ARRAY_SIZE(sensor_2p6_setfile_A_2304x1728_15fps), + ARRAY_SIZE(sensor_2p6_setfile_A_2304x1312_30fps), + ARRAY_SIZE(sensor_2p6_setfile_A_2304x1120_30fps), + ARRAY_SIZE(sensor_2p6_setfile_A_1152x864_120fps), + ARRAY_SIZE(sensor_2p6_setfile_A_1152x656_120fps), }; static const struct sensor_pll_info_compact *sensor_2p6_pllinfos_A[] = diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setB.h b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setB.h index b502b3034130..113a658441ce 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setB.h +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6-setB.h @@ -500,15 +500,15 @@ static const u32 *sensor_2p6_setfiles_B[] = { static const u32 sensor_2p6_setfile_B_sizes[] = { /* 16x12 margin */ - sizeof(sensor_2p6_setfile_B_4608x3456_30fps) / sizeof(sensor_2p6_setfile_B_4608x3456_30fps[0]), - sizeof(sensor_2p6_setfile_B_4608x2624_30fps) / sizeof(sensor_2p6_setfile_B_4608x2624_30fps[0]), - sizeof(sensor_2p6_setfile_B_4608x2240_30fps) / sizeof(sensor_2p6_setfile_B_4608x2240_30fps[0]), - sizeof(sensor_2p6_setfile_B_2304x1728_30fps) / sizeof(sensor_2p6_setfile_B_2304x1728_30fps[0]), - sizeof(sensor_2p6_setfile_B_2304x1728_15fps) / sizeof(sensor_2p6_setfile_B_2304x1728_15fps[0]), - sizeof(sensor_2p6_setfile_B_2304x1312_30fps) / sizeof(sensor_2p6_setfile_B_2304x1312_30fps[0]), - sizeof(sensor_2p6_setfile_B_2304x1120_30fps) / sizeof(sensor_2p6_setfile_B_2304x1120_30fps[0]), - sizeof(sensor_2p6_setfile_B_1152x864_120fps) / sizeof(sensor_2p6_setfile_B_1152x864_120fps[0]), - sizeof(sensor_2p6_setfile_B_1152x656_120fps) / sizeof(sensor_2p6_setfile_B_1152x656_120fps[0]), + ARRAY_SIZE(sensor_2p6_setfile_B_4608x3456_30fps), + ARRAY_SIZE(sensor_2p6_setfile_B_4608x2624_30fps), + ARRAY_SIZE(sensor_2p6_setfile_B_4608x2240_30fps), + ARRAY_SIZE(sensor_2p6_setfile_B_2304x1728_30fps), + ARRAY_SIZE(sensor_2p6_setfile_B_2304x1728_15fps), + ARRAY_SIZE(sensor_2p6_setfile_B_2304x1312_30fps), + ARRAY_SIZE(sensor_2p6_setfile_B_2304x1120_30fps), + ARRAY_SIZE(sensor_2p6_setfile_B_1152x864_120fps), + ARRAY_SIZE(sensor_2p6_setfile_B_1152x656_120fps), }; static const struct sensor_pll_info_compact *sensor_2p6_pllinfos_B[] = diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c index 3a3bc7a7ad24..d936478db92c 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2p6.c @@ -1866,26 +1866,26 @@ int cis_2p6_probe(struct i2c_client *client, strcmp(setfile, "setA") == 0) { probe_info("%s : setfile_A for Non-PDAF\n", __func__); sensor_2p6_global = sensor_2p6_setfile_A_Global; - sensor_2p6_global_size = sizeof(sensor_2p6_setfile_A_Global) / sizeof(sensor_2p6_setfile_A_Global[0]); + sensor_2p6_global_size = ARRAY_SIZE(sensor_2p6_setfile_A_Global); sensor_2p6_setfiles = sensor_2p6_setfiles_A; sensor_2p6_setfile_sizes = sensor_2p6_setfile_A_sizes; - sensor_2p6_max_setfile_num = sizeof(sensor_2p6_setfiles_A) / sizeof(sensor_2p6_setfiles_A[0]); + sensor_2p6_max_setfile_num = ARRAY_SIZE(sensor_2p6_setfiles_A); sensor_2p6_pllinfos = sensor_2p6_pllinfos_A; } else if (strcmp(setfile, "setB") == 0) { probe_info("%s setfile_B for PDAF\n", __func__); sensor_2p6_pdaf_global = sensor_2p6_setfile_B_Global; - sensor_2p6_pdaf_global_size = sizeof(sensor_2p6_setfile_B_Global) / sizeof(sensor_2p6_setfile_B_Global[0]); + sensor_2p6_pdaf_global_size = ARRAY_SIZE(sensor_2p6_setfile_B_Global); sensor_2p6_pdaf_setfiles = sensor_2p6_setfiles_B; sensor_2p6_pdaf_setfile_sizes = sensor_2p6_setfile_B_sizes; - sensor_2p6_pdaf_max_setfile_num = sizeof(sensor_2p6_setfiles_B) / sizeof(sensor_2p6_setfiles_B[0]); + sensor_2p6_pdaf_max_setfile_num = ARRAY_SIZE(sensor_2p6_setfiles_B); sensor_2p6_pdaf_pllinfos = sensor_2p6_pllinfos_B; } else { err("%s setfile index out of bound, take default (setfile_A)", __func__); sensor_2p6_global = sensor_2p6_setfile_A_Global; - sensor_2p6_global_size = sizeof(sensor_2p6_setfile_A_Global) / sizeof(sensor_2p6_setfile_A_Global[0]); + sensor_2p6_global_size = ARRAY_SIZE(sensor_2p6_setfile_A_Global); sensor_2p6_setfiles = sensor_2p6_setfiles_A; sensor_2p6_setfile_sizes = sensor_2p6_setfile_A_sizes; - sensor_2p6_max_setfile_num = sizeof(sensor_2p6_setfiles_A) / sizeof(sensor_2p6_setfiles_A[0]); + sensor_2p6_max_setfile_num = ARRAY_SIZE(sensor_2p6_setfiles_A); sensor_2p6_pllinfos = sensor_2p6_pllinfos_A; } -- 2.20.1