aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Ni <wni@nvidia.com>2016-04-06 05:48:04 -0400
committerEduardo Valentin <edubezval@gmail.com>2016-05-17 10:28:31 -0400
commitf350098070e36e1f51f925264146eff18a4e42dd (patch)
tree4043677e3084d53a5d185365166103513874f407
parenta977c41ec65bbdc5000a130372adba1f85c86833 (diff)
thermal: tegra: fix static checker warning
There has a static checker warning: warn: variable dereferenced before check 'dev' (see line 222) Since check 'dev' is unnecessary, so remove this check. Fixes: ee6d79f202a4 ("thermal: tegra: add thermtrip function") Signed-off-by: Wei Ni <wni@nvidia.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/tegra/soctherm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index be829d6e131c..2b0417d7b754 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -223,10 +223,7 @@ static int thermtrip_program(struct device *dev,
223 int temp; 223 int temp;
224 u32 r; 224 u32 r;
225 225
226 if (!dev || !sg) 226 if (!sg || !sg->thermtrip_threshold_mask)
227 return -EINVAL;
228
229 if (!sg->thermtrip_threshold_mask)
230 return -EINVAL; 227 return -EINVAL;
231 228
232 temp = enforce_temp_range(dev, trip_temp) / ts->soc->thresh_grain; 229 temp = enforce_temp_range(dev, trip_temp) / ts->soc->thresh_grain;