* [PATCH] thermal: tegra: fix static checker warning
@ 2016-04-06 9:48 Wei Ni
0 siblings, 0 replies; only message in thread
From: Wei Ni @ 2016-04-06 9:48 UTC (permalink / raw)
To: edubezval, rui.zhang, dan.carpenter
Cc: thierry.reding, MLongnecker, swarren, mikko.perttunen,
linux-tegra, linux-pm, linux-kernel, Wei Ni
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>
---
drivers/thermal/tegra/soctherm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 559c74279eb8..d3cc8c99726f 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -223,10 +223,7 @@ static int thermtrip_program(struct device *dev,
int temp;
u32 r;
- if (!dev || !sg)
- return -EINVAL;
-
- if (!sg->thermtrip_threshold_mask)
+ if (!sg || !sg->thermtrip_threshold_mask)
return -EINVAL;
temp = enforce_temp_range(dev, trip_temp) / ts->soc->thresh_grain;
--
1.9.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-06 9:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06 9:48 [PATCH] thermal: tegra: fix static checker warning Wei Ni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®