Skip to contentSkip to conversation

cpufreq: scpi: remove arm_big_little dependency

bug report In review Dan Carpenter 4 participants 5 messages Jan 22, 2018 – Feb 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Sudeep Holla,

The patch 343a8d17fa8d: "cpufreq: scpi: remove arm_big_little dependency" from Jan 10, 2018, leads to the following static checker warning:

drivers/cpufreq/scpi-cpufreq.c:203 scpi_cpufreq_ready()
warn: 'cdev' isn't an ERR_PTR

drivers/cpufreq/scpi-cpufreq.c
198 static void scpi_cpufreq_ready(struct cpufreq_policy *policy) 199 {
200 struct scpi_data *priv = policy->driver_data;
201 struct thermal_cooling_device *cdev;
202
203 cdev = of_cpufreq_cooling_register(policy);
204 if (!IS_ERR(cdev))
205 priv->cdev = cdev;

of_cpufreq_cooling_register() returns NULL on error. Probably just remove the if statement?

206 }

regards,
dan carpenter

#1 lore raw

Hi Dan,

Quoted 19 lines · Dan Carpenter

Hello Sudeep Holla,

The patch 343a8d17fa8d: "cpufreq: scpi: remove arm_big_little dependency" from Jan 10, 2018, leads to the following static checker warning:

drivers/cpufreq/scpi-cpufreq.c:203 scpi_cpufreq_ready()
warn: 'cdev' isn't an ERR_PTR

drivers/cpufreq/scpi-cpufreq.c
198 static void scpi_cpufreq_ready(struct cpufreq_policy *policy)

   199  {
   200          struct scpi_data *priv = policy->driver_data;
   201          struct thermal_cooling_device *cdev;
   202  
   203          cdev = of_cpufreq_cooling_register(policy);
   204          if (!IS_ERR(cdev))
   205                  priv->cdev = cdev;
Quoted 5 lines

of_cpufreq_cooling_register() returns NULL on error. Probably just remove the if statement?

   206  }

Thanks for the report, will post the fix soon.

Signature · 2 lines
Regards,
Sudeep
#2 lore raw

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

In reply to Dan Carpenter

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")
Cc Rafael J. Wysocki <[email protected]>
Cc Viresh Kumar <[email protected]>
---
 drivers/cpufreq/scpi-cpufreq.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpufreq/scpi-cpufreq.c +1 -4
index 247fcbfa4cb5..efe32cbefa06 100644
@@ -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 = {
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#3 lore raw

Re: [PATCH] cpufreq: scpi: fix static checker warning cdev isn't an ERR_PTR

Quoted 9 lines · Sudeep Holla

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.

Quoted 8 lines
Fixes 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")
Cc Rafael J. Wysocki <[email protected]>
Cc Viresh Kumar <[email protected]>
---
 drivers/cpufreq/scpi-cpufreq.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
viresh
#4 lore raw

Re: [PATCH] cpufreq: scpi: fix static checker warning cdev isn't an ERR_PTR

Quoted 19 lines · CET Viresh Kumar
Quoted 9 lines · Sudeep Holla

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.

Quoted 8 lines
Fixes 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")
Cc Rafael J. Wysocki <[email protected]>
Cc Viresh Kumar <[email protected]>
---
 drivers/cpufreq/scpi-cpufreq.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Quoted 1 line

Patch applied, thanks!