lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f51db20-3822-4be7-ba13-e858aab25dad@huawei.com>
Date: Tue, 2 Dec 2025 09:32:37 +0800
From: "zhenglifeng (A)" <zhenglifeng1@...wei.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
CC: <rafael@...nel.org>, <linux-pm@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
	<jonathan.cameron@...wei.com>, <zhanjie9@...ilicon.com>,
	<lihuisong@...wei.com>, <yubowen8@...wei.com>, <zhangpengjie2@...wei.com>,
	<wangzhi12@...wei.com>, <linhongye@...artners.com>
Subject: Re: [PATCH v2 2/2] cpufreq: cpufreq_boost_trigger_state()
 optimization

On 2025/12/1 11:42, Viresh Kumar wrote:
> On 28-11-25, 17:13, Lifeng Zheng wrote:
>> Simplify the error handling branch code in cpufreq_boost_trigger_state().
>>
>> Signed-off-by: Lifeng Zheng <zhenglifeng1@...wei.com>
>> ---
>>  drivers/cpufreq/cpufreq.c | 11 +++--------
>>  1 file changed, 3 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index a4399e5490da..a725747572c9 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -2824,18 +2824,13 @@ static int cpufreq_boost_trigger_state(int state)
>>  
>>  		ret = policy_set_boost(policy, state);
>>  		if (ret)
>> -			goto err_reset_state;
>> +			break;
>>  	}
>>  
>> -	if (ret)
>> -		goto err_reset_state;
>> -
>>  	cpus_read_unlock();
>>  
>> -	return 0;
>> -
>> -err_reset_state:
>> -	cpus_read_unlock();
>> +	if (!ret)
> 
> Maybe we can make this `if (likely(!ret))`

For the platforms which are not boost supported, this will never be
matched. Is `likely` OK in this situation?

> 
>> +		return 0;
>>  
>>  	write_lock_irqsave(&cpufreq_driver_lock, flags);
>>  	cpufreq_driver->boost_enabled = !state;
> 
> Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ