thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state()
Subsystems (2)
PATCH 1/1 thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state()
Return freq_qos_update_request() errors directly to simplify the code.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/thermal/cpufreq_cooling.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/thermal/cpufreq_cooling.c +5 -5
@@ -488,12 +488,12 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, frequency =get_state_freq (cpufreq_cdev, state); ret =freq_qos_update_request (&cpufreq_cdev->qos_req, frequency); -if (ret >=0 ) { - cpufreq_cdev->cpufreq_state = state; - ret =0 ; - } +if (ret <0 ) +return ret; + + cpufreq_cdev->cpufreq_state = state; -return ret; +return 0 ; }/**
Quoted 20 lines · Thorsten Blum
Return
freq_qos_update_request()errors directly to simplify the code.Signed-off-by Thorsten Blum <[email protected]>--- drivers/thermal/cpufreq_cooling.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/thermal/cpufreq_cooling.c +0
-4@@ -488,12 +488,12 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, frequency =get_state_freq (cpufreq_cdev, state); ret =freq_qos_update_request (&cpufreq_cdev->qos_req, frequency); -if (ret >=0 ) { - cpufreq_cdev->cpufreq_state = state; - ret =0 ; - }
drivers/thermal/cpufreq_cooling.c static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, · line 499
Quoted 10 lines
drivers/thermal/cpufreq_cooling.c +5
-1+if (ret <0 ) +return ret; + + cpufreq_cdev->cpufreq_state = state; -return ret; +return 0 ; }/**
Applied as 7.4 material, thanks!