thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state
Subsystems (2)
PATCH 1/1 thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state
The function freq_qos_update_request returns 0 or 1 describing update effectiveness, and a negative error code on failure. However, cpufreq_set_cur_state returns 0 on success or an error code otherwise.
--- drivers/thermal/cpufreq_cooling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/thermal/cpufreq_cooling.c +4 -2
@@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) {struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; +int ret;/* Request state should be less than max_level */ if (WARN_ON (state > cpufreq_cdev->max_level))
@@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, cpufreq_cdev->cpufreq_state = state; -return freq_qos_update_request (&cpufreq_cdev->qos_req, -get_state_freq (cpufreq_cdev, state)); + ret =freq_qos_update_request (&cpufreq_cdev->qos_req, +get_state_freq (cpufreq_cdev, state)); +return ret <0 ? ret :0 ; }/* Bind cpufreq callbacks to thermal cooling device ops */
Signature · 1 line
2.20.1
Quoted 23 lines · Willy Wolff
The function
freq_qos_update_requestreturns 0 or 1 describing update effectiveness, and a negative error code on failure. However,cpufreq_set_cur_statereturns 0 on success or an error code otherwise.Signed-off-by Willy Wolff <[email protected]>--- drivers/thermal/cpufreq_cooling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/thermal/cpufreq_cooling.c +1
-0@@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) {struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; +int ret;/* Request state should be less than max_level */ if (WARN_ON (state > cpufreq_cdev->max_level))@@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
drivers/thermal/cpufreq_cooling.c static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, · line 451
Quoted 10 lines
drivers/thermal/cpufreq_cooling.c +3
-2cpufreq_cdev->cpufreq_state = state; -return freq_qos_update_request (&cpufreq_cdev->qos_req, -get_state_freq (cpufreq_cdev, state)); + ret =freq_qos_update_request (&cpufreq_cdev->qos_req, +get_state_freq (cpufreq_cdev, state)); +return ret <0 ? ret :0 ; }/* Bind cpufreq callbacks to thermal cooling device ops */
Signature · 1 line
viresh
Hi Willy,
Quoted 5 lines · Willy Wolff
The function
freq_qos_update_requestreturns 0 or 1 describing update effectiveness, and a negative error code on failure. However,cpufreq_set_cur_statereturns 0 on success or an error code otherwise.
Please improve the commit message with context from your earlier bug report thread and a summary of how the problem shows up.
Thanks,
Amit
Quoted 32 lines
Signed-off-by Willy Wolff <[email protected]>--- drivers/thermal/cpufreq_cooling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/thermal/cpufreq_cooling.c +4
-3@@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) {struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; +int ret;/* Request state should be less than max_level */ if (WARN_ON (state > cpufreq_cdev->max_level))@@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, cpufreq_cdev->cpufreq_state = state; -return freq_qos_update_request (&cpufreq_cdev->qos_req, -get_state_freq (cpufreq_cdev, state)); + ret =freq_qos_update_request (&cpufreq_cdev->qos_req, +get_state_freq (cpufreq_cdev, state)); +return ret <0 ? ret :0 ; }/* Bind cpufreq callbacks to thermal cooling device ops */ --2.20.1
Quoted 11 lines · Amit Kucheria
Hi Willy,
Quoted 5 lines · Willy Wolff
The function
freq_qos_update_requestreturns 0 or 1 describing update effectiveness, and a negative error code on failure. However,cpufreq_set_cur_statereturns 0 on success or an error code otherwise.Please improve the commit message with context from your earlier bug report thread and a summary of how the problem shows up.
I've improved the commit message when applied:
Quoted 32 lines
Quoted 32 lines
Signed-off-by Willy Wolff <[email protected]>--- drivers/thermal/cpufreq_cooling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/thermal/cpufreq_cooling.c +4
-3@@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) {struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; +int ret;/* Request state should be less than max_level */ if (WARN_ON (state > cpufreq_cdev->max_level))@@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, cpufreq_cdev->cpufreq_state = state; -return freq_qos_update_request (&cpufreq_cdev->qos_req, -get_state_freq (cpufreq_cdev, state)); + ret =freq_qos_update_request (&cpufreq_cdev->qos_req, +get_state_freq (cpufreq_cdev, state)); +return ret <0 ? ret :0 ; }/* Bind cpufreq callbacks to thermal cooling device ops */ --2.20.1
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Many thanks.
Quoted 58 lines · Daniel Lezcano
Quoted 11 lines · Amit Kucheria
Hi Willy,
Quoted 5 lines · Willy Wolff
The function
freq_qos_update_requestreturns 0 or 1 describing update effectiveness, and a negative error code on failure. However,cpufreq_set_cur_statereturns 0 on success or an error code otherwise.Please improve the commit message with context from your earlier bug report thread and a summary of how the problem shows up.
I've improved the commit message when applied:
Quoted 32 lines
Quoted 32 lines
Signed-off-by Willy Wolff <[email protected]>--- drivers/thermal/cpufreq_cooling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/thermal/cpufreq_cooling.c +4
-3@@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) {struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; +int ret;/* Request state should be less than max_level */ if (WARN_ON (state > cpufreq_cdev->max_level))@@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, cpufreq_cdev->cpufreq_state = state; -return freq_qos_update_request (&cpufreq_cdev->qos_req, -get_state_freq (cpufreq_cdev, state)); + ret =freq_qos_update_request (&cpufreq_cdev->qos_req, +get_state_freq (cpufreq_cdev, state)); +return ret <0 ? ret :0 ; }/* Bind cpufreq callbacks to thermal cooling device ops */ --2.20.1
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog