cpufreq: scpi: remove arm_big_little dependency
Subsystems (2)
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
Hi Dan,
Quoted 19 lines · Dan Carpenter
Hello Sudeep Holla,
The patch
343a8d17fa8d: "cpufreq: scpi: removearm_big_littledependency" from Jan 10, 2018, leads to the following static checker warning:
drivers/cpufreq/scpi-cpufreq.c:203scpi_cpufreq_ready()
warn: 'cdev' isn't anERR_PTR
drivers/cpufreq/scpi-cpufreq.c
198 static voidscpi_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
PATCH 1/1 cpufreq: scpi: fix static checker warning cdev isn't an ERR_PTR
In reply to Dan CarpenterCommit 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.
--- drivers/cpufreq/scpi-cpufreq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpufreq/scpi-cpufreq.c +1 -4
@@ -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
Re: [PATCH] cpufreq: scpi: fix static checker warning cdev isn't an ERR_PTR
Quoted 9 lines · Sudeep Holla
Commit
343a8d17fa8d("cpufreq: scpi: removearm_big_littledependency") leads to the following static checker warning:
drivers/cpufreq/scpi-cpufreq.c:203scpi_cpufreq_ready()
warn: 'cdev' isn't anERR_PTR
of_cpufreq_cooling_register()returns NULL on error. This patch removes the incorrectIS_ERRcheck on the returned pointer.
Quoted 8 lines
Fixes 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")Reported-by Dan Carpenter <[email protected]>Cc Rafael J. Wysocki <[email protected]>Cc Viresh Kumar <[email protected]>Signed-off-by Sudeep Holla <[email protected]>--- drivers/cpufreq/scpi-cpufreq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
viresh
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: removearm_big_littledependency") leads to the following static checker warning:
drivers/cpufreq/scpi-cpufreq.c:203scpi_cpufreq_ready()
warn: 'cdev' isn't anERR_PTR
of_cpufreq_cooling_register()returns NULL on error. This patch removes the incorrectIS_ERRcheck on the returned pointer.Quoted 8 lines
Fixes 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")Reported-by Dan Carpenter <[email protected]>Cc Rafael J. Wysocki <[email protected]>Cc Viresh Kumar <[email protected]>Signed-off-by Sudeep Holla <[email protected]>--- drivers/cpufreq/scpi-cpufreq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Quoted 1 line
Acked-by Viresh Kumar <[email protected]>
Patch applied, thanks!