From f350098070e36e1f51f925264146eff18a4e42dd Mon Sep 17 00:00:00 2001 From: Wei Ni Date: Wed, 6 Apr 2016 17:48:04 +0800 Subject: [PATCH] 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 Reported-by: Dan Carpenter Signed-off-by: Eduardo Valentin --- 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 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, 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; -- GitLab