cpufreq: scpi: fix static checker warning cdev isn't an ERR_PTR

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/eb85c50c24cf3e96f9aa01fd3e6219ad36845a96
Commit:     eb85c50c24cf3e96f9aa01fd3e6219ad36845a96
Parent:     3d70671667f15f4bae260541cd91330ef20d2f2e
Refname:    refs/heads/master
Author:     Sudeep Holla <[email protected]>
AuthorDate: Mon Jan 22 14:41:07 2018 +0000
Committer:  Rafael J. Wysocki <[email protected]>
CommitDate: Wed Feb 7 11:51:41 2018 +0100

    cpufreq: scpi: fix static checker warning cdev isn't an ERR_PTR
    
    Commit 343a8d17fa8d (cpufreq: scpi: remove arm_big_little dependency)
    leads to the following static checker warning:
    
            drivers/cpufreq/scpi-cpufreq.c:203 scpi_cpufreq_ready()
            warn: 'cdev' isn't an ERR_PTR
    
    of_cpufreq_cooling_register() returns NULL on error. This patch removes
    the incorrect IS_ERR check on the returned pointer.
    
    Fixes: 343a8d17fa8d (cpufreq: scpi: remove arm_big_little dependency)
    Reported-by: Dan Carpenter <[email protected]>
    Signed-off-by: Sudeep Holla <[email protected]>
    Acked-by: Viresh Kumar <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
---
 drivers/cpufreq/scpi-cpufreq.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index 247fcbfa4cb5..efe32cbefa06 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -197,11 +197,8 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy)
 static void scpi_cpufreq_ready(struct cpufreq_policy *policy)
 {
 	struct scpi_data *priv = policy->driver_data;
-	struct thermal_cooling_device *cdev;
 
-	cdev = of_cpufreq_cooling_register(policy);
-	if (!IS_ERR(cdev))
-		priv->cdev = cdev;
+	priv->cdev = of_cpufreq_cooling_register(policy);
 }
 
 static struct cpufreq_driver scpi_cpufreq_driver = {
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.