thermal: devfreq: Simplify expression
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 7 Feb 2017 04:10:01 +0000 (09:40 +0530)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 13 Sep 2017 10:24:00 +0000 (19:24 +0900)
There is no need to check for IS_ERR() as we are looking for a very
particular error value here. Drop the first check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/devfreq_cooling.c

index a667ba779a4384caf6343e23c7f2e465c2980869..d5378291ca19aad90268681ed348aa43026937d4 100644 (file)
@@ -188,7 +188,7 @@ get_static_power(struct devfreq_cooling_device *dfc, unsigned long freq)
        rcu_read_lock();
 
        opp = dev_pm_opp_find_freq_exact(dev, freq, true);
-       if (IS_ERR(opp) && (PTR_ERR(opp) == -ERANGE))
+       if (PTR_ERR(opp) == -ERANGE)
                opp = dev_pm_opp_find_freq_exact(dev, freq, false);
 
        voltage = dev_pm_opp_get_voltage(opp) / 1000; /* mV */