diff mbox series

[1/2] cpufreq: Fix a comment in cpufreq_policy_free

Message ID 20211130151526.949-2-tangyizhou@huawei.com (mailing list archive)
State Superseded, archived
Headers show
Series cpufreq: Update function comment and document | expand

Commit Message

Tang Yizhou Nov. 30, 2021, 3:15 p.m. UTC
The comment is inconsistent with the block_notifier_call_chain() call,
so fix it.

Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
---
 drivers/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar Dec. 1, 2021, 4:22 a.m. UTC | #1
On 30-11-21, 23:15, Tang Yizhou wrote:
> The comment is inconsistent with the block_notifier_call_chain() call,
> so fix it.
> 
> Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
> ---
>  drivers/cpufreq/cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index e338d2f010fe..8f753675e4a2 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1296,7 +1296,7 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)
>  
>  	if (policy->max_freq_req) {
>  		/*
> -		 * CPUFREQ_CREATE_POLICY notification is sent only after
> +		 * CPUFREQ_REMOVE_POLICY notification is sent only after

No, the earlier comment is correct. It says when the CREATE notification was
sent and so we need to do the remove here before removing max_freq_req.

>  		 * successfully adding max_freq_req request.
>  		 */
>  		blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
> -- 
> 2.17.1
Tang Yizhou Dec. 1, 2021, 6:39 a.m. UTC | #2
On 2021/12/1 12:22, Viresh Kumar wrote:
> On 30-11-21, 23:15, Tang Yizhou wrote:
>> The comment is inconsistent with the block_notifier_call_chain() call,
>> so fix it.
>>
>> Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
>> ---
>>  drivers/cpufreq/cpufreq.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index e338d2f010fe..8f753675e4a2 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -1296,7 +1296,7 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)
>>  
>>  	if (policy->max_freq_req) {
>>  		/*
>> -		 * CPUFREQ_CREATE_POLICY notification is sent only after
>> +		 * CPUFREQ_REMOVE_POLICY notification is sent only after
> 
> No, the earlier comment is correct. It says when the CREATE notification was
> sent and so we need to do the remove here before removing max_freq_req.

I see. I was confused at the first time. Perhaps it is better to both comment when
CPUFREQ_CREATE_POLICY and CPUFREQ_REMOVE_POLICY notification is sent.

> 
>>  		 * successfully adding max_freq_req request.
>>  		 */
>>  		blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
>> -- 
>> 2.17.1
> 

Tang
Viresh Kumar Dec. 1, 2021, 6:47 a.m. UTC | #3
On 01-12-21, 14:39, Tang Yizhou wrote:
> On 2021/12/1 12:22, Viresh Kumar wrote:
> > On 30-11-21, 23:15, Tang Yizhou wrote:
> >> The comment is inconsistent with the block_notifier_call_chain() call,
> >> so fix it.
> >>
> >> Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
> >> ---
> >>  drivers/cpufreq/cpufreq.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> >> index e338d2f010fe..8f753675e4a2 100644
> >> --- a/drivers/cpufreq/cpufreq.c
> >> +++ b/drivers/cpufreq/cpufreq.c
> >> @@ -1296,7 +1296,7 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)
> >>  
> >>  	if (policy->max_freq_req) {
> >>  		/*
> >> -		 * CPUFREQ_CREATE_POLICY notification is sent only after
> >> +		 * CPUFREQ_REMOVE_POLICY notification is sent only after
> > 
> > No, the earlier comment is correct. It says when the CREATE notification was
> > sent and so we need to do the remove here before removing max_freq_req.
> 
> I see. I was confused at the first time. Perhaps it is better to both comment when
> CPUFREQ_CREATE_POLICY and CPUFREQ_REMOVE_POLICY notification is sent.

I am fine with elaborating the comment, sure. Please send another patch for
that.
diff mbox series

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index e338d2f010fe..8f753675e4a2 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1296,7 +1296,7 @@  static void cpufreq_policy_free(struct cpufreq_policy *policy)
 
 	if (policy->max_freq_req) {
 		/*
-		 * CPUFREQ_CREATE_POLICY notification is sent only after
+		 * CPUFREQ_REMOVE_POLICY notification is sent only after
 		 * successfully adding max_freq_req request.
 		 */
 		blocking_notifier_call_chain(&cpufreq_policy_notifier_list,