diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2014-07-31 13:11:01 -0400 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2014-11-02 22:02:47 -0500 |
commit | 930aa102e2b0ba70ea420999362e2edc4fda15d3 (patch) | |
tree | d9b06dc70e7e4c8f78c6b3f36ea1a302b41e4feb | |
parent | d37761ecde5f151f4748309fedaa1db53832cc2c (diff) |
thermal: exynos: remove redundant pdata checks from exynos_tmu_initialize()
Remove runtime checks for pdata sanity from exynos_tmu_initialize().
The current values hardcoded in pdata will never trigger the checks
and checking itself is not proper. The checks in question are done
at runtime in a production code for data that is hardcoded inside
driver during development time and later it doesn't change. Such
data should be verified during development and review time (i.e. by
a script parsing relevant data from exynos_tmu_data.c, one can also
argue that verification to be done is so simple that the review by
a maintainer should be enough).
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r-- | drivers/thermal/samsung/exynos_thermal_common.h | 1 | ||||
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 13 |
2 files changed, 0 insertions, 14 deletions
diff --git a/drivers/thermal/samsung/exynos_thermal_common.h b/drivers/thermal/samsung/exynos_thermal_common.h index 3eb2ed9ea3a4..cd4471925cdd 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.h +++ b/drivers/thermal/samsung/exynos_thermal_common.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #define SENSOR_NAME_LEN 16 | 27 | #define SENSOR_NAME_LEN 16 |
28 | #define MAX_TRIP_COUNT 8 | 28 | #define MAX_TRIP_COUNT 8 |
29 | #define MAX_COOLING_DEVICE 4 | 29 | #define MAX_COOLING_DEVICE 4 |
30 | #define MAX_THRESHOLD_LEVS 5 | ||
31 | 30 | ||
32 | #define ACTIVE_INTERVAL 500 | 31 | #define ACTIVE_INTERVAL 500 |
33 | #define IDLE_INTERVAL 10000 | 32 | #define IDLE_INTERVAL 10000 |
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 4a55f112cc67..b9bffad68334 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
@@ -201,23 +201,10 @@ static int exynos_tmu_initialize(struct platform_device *pdev) | |||
201 | (pdata->efuse_value >> reg->triminfo_85_shift) & | 201 | (pdata->efuse_value >> reg->triminfo_85_shift) & |
202 | EXYNOS_TMU_TEMP_MASK; | 202 | EXYNOS_TMU_TEMP_MASK; |
203 | 203 | ||
204 | if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) { | ||
205 | dev_err(&pdev->dev, "Invalid max trigger level\n"); | ||
206 | ret = -EINVAL; | ||
207 | goto out; | ||
208 | } | ||
209 | |||
210 | for (i = 0; i < pdata->max_trigger_level; i++) { | 204 | for (i = 0; i < pdata->max_trigger_level; i++) { |
211 | if (!pdata->trigger_levels[i]) | 205 | if (!pdata->trigger_levels[i]) |
212 | continue; | 206 | continue; |
213 | 207 | ||
214 | if ((pdata->trigger_type[i] == HW_TRIP) && | ||
215 | (!pdata->trigger_levels[pdata->max_trigger_level - 1])) { | ||
216 | dev_err(&pdev->dev, "Invalid hw trigger level\n"); | ||
217 | ret = -EINVAL; | ||
218 | goto out; | ||
219 | } | ||
220 | |||
221 | /* Count trigger levels except the HW trip*/ | 208 | /* Count trigger levels except the HW trip*/ |
222 | if (!(pdata->trigger_type[i] == HW_TRIP)) | 209 | if (!(pdata->trigger_type[i] == HW_TRIP)) |
223 | trigger_levs++; | 210 | trigger_levs++; |