From 589ae2ab7b9f72cfc643c1752bc55ea1f101a48e Mon Sep 17 00:00:00 2001 From: Jeongtae Park Date: Tue, 3 Jul 2018 17:57:48 +0900 Subject: [PATCH] [COMMON] fimc-is2: use 32bit variables for pattern generator control Prevent Defect ID: CID 233701 PR JIRA ID: CPR-32 Change-Id: I114817bbc96282fc4bd10993ca9b1f3982bdc215 Signed-off-by: Jeongtae Park --- .../media/platform/exynos/fimc-is2/fimc-is-core.c | 12 ++++++------ .../media/platform/exynos/fimc-is2/fimc-is-core.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c index 96fb1e7ed517..f31b09247287 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-core.c @@ -594,7 +594,7 @@ static ssize_t store_en_dvfs(struct device *dev, static ssize_t show_pattern_en(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%lu\n", sysfs_debug.pattern_en); + return snprintf(buf, PAGE_SIZE, "%u\n", sysfs_debug.pattern_en); } static ssize_t store_pattern_en(struct device *dev, @@ -602,11 +602,11 @@ static ssize_t store_pattern_en(struct device *dev, const char *buf, size_t count) { int ret = 0; - unsigned long cmd; + unsigned int cmd; struct fimc_is_core *core = (struct fimc_is_core *)platform_get_drvdata(to_platform_device(dev)); - ret = kstrtoul(buf, 0, &cmd); + ret = kstrtouint(buf, 0, &cmd); if (ret) return ret; @@ -629,7 +629,7 @@ static ssize_t store_pattern_en(struct device *dev, static ssize_t show_pattern_fps(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%lu\n", sysfs_debug.pattern_fps); + return snprintf(buf, PAGE_SIZE, "%u\n", sysfs_debug.pattern_fps); } static ssize_t store_pattern_fps(struct device *dev, @@ -637,9 +637,9 @@ static ssize_t store_pattern_fps(struct device *dev, const char *buf, size_t count) { int ret = 0; - unsigned long cmd; + unsigned int cmd; - ret = kstrtoul(buf, 0, &cmd); + ret = kstrtouint(buf, 0, &cmd); if (ret) return ret; diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-core.h b/drivers/media/platform/exynos/fimc-is2/fimc-is-core.h index 0c8f108201ff..5bcfc713d6ff 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-core.h +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-core.h @@ -224,8 +224,8 @@ struct fimc_is_sysfs_debug { unsigned int en_dvfs; unsigned int en_clk_gate; unsigned int clk_gate_mode; - unsigned long pattern_en; - unsigned long pattern_fps; + unsigned int pattern_en; + unsigned int pattern_fps; unsigned long hal_debug_mode; unsigned int hal_debug_delay; }; -- 2.20.1