]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
thermal: devfreq: Simplify expression
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 7 Feb 2017 04:10:01 +0000 (09:40 +0530)
committerZhang Rui <rui.zhang@intel.com>
Mon, 13 Mar 2017 02:06:26 +0000 (10:06 +0800)
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 7743a78d472397bbf9a10c0b1ac2d7e4b163a6a6..4793fc7b06dd3f200335b3b5515f0e44a87966dd 100644 (file)
@@ -186,7 +186,7 @@ get_static_power(struct devfreq_cooling_device *dfc, unsigned long freq)
                return 0;
 
        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 */