From: Jeongtae Park Date: Tue, 3 Jul 2018 08:57:48 +0000 (+0900) Subject: [COMMON] fimc-is2: use 32bit variables for pattern generator control X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de3c4670e0caf972362f6e6c961faa8ddeb3d362;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 --- 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; };