thermal: tegra: fix static checker warning
authorWei Ni <wni@nvidia.com>
Wed, 6 Apr 2016 09:48:04 +0000 (17:48 +0800)
committerEduardo Valentin <edubezval@gmail.com>
Tue, 17 May 2016 14:28:31 +0000 (07:28 -0700)
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>
drivers/thermal/tegra/soctherm.c

index be829d6..2b0417d 100644 (file)
@@ -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;