mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] cpufreq: intel_pstate: Rearrange variable declaration involving __free()
@ 2025-09-03 14:59 Rafael J. Wysocki
  2025-09-03 15:08 ` Krzysztof Kozlowski
  2025-09-04  4:15 ` Viresh Kumar
  0 siblings, 2 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2025-09-03 14:59 UTC (permalink / raw)
  To: Linux PM
  Cc: LKML, Viresh Kumar, Krzysztof Kozlowski, Zihuan Zhang,
	Srinivas Pandruvada

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Follow cleanup.h recommendations and define and assign a variable
in one statement when __free() is used.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

Zhang, I said the code structure here was intentional, but that was before
the cleanup.h recommendation was pointed out to me.

---
 drivers/cpufreq/intel_pstate.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1502,9 +1502,7 @@ static void __intel_pstate_update_max_fr
 
 static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
 {
-	struct cpufreq_policy *policy __free(put_cpufreq_policy);
-
-	policy = cpufreq_cpu_get(cpudata->cpu);
+	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
 	if (!policy)
 		return false;
 




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] cpufreq: intel_pstate: Rearrange variable declaration involving __free()
  2025-09-03 14:59 [PATCH v1] cpufreq: intel_pstate: Rearrange variable declaration involving __free() Rafael J. Wysocki
@ 2025-09-03 15:08 ` Krzysztof Kozlowski
  2025-09-04  4:15 ` Viresh Kumar
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-09-03 15:08 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux PM
  Cc: LKML, Viresh Kumar, Zihuan Zhang, Srinivas Pandruvada

On 03/09/2025 16:59, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Follow cleanup.h recommendations and define and assign a variable
> in one statement when __free() is used.
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] cpufreq: intel_pstate: Rearrange variable declaration involving __free()
  2025-09-03 14:59 [PATCH v1] cpufreq: intel_pstate: Rearrange variable declaration involving __free() Rafael J. Wysocki
  2025-09-03 15:08 ` Krzysztof Kozlowski
@ 2025-09-04  4:15 ` Viresh Kumar
  2025-09-04  4:32   ` Zihuan Zhang
  1 sibling, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2025-09-04  4:15 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM, LKML, Krzysztof Kozlowski, Zihuan Zhang, Srinivas Pandruvada

On 03-09-25, 16:59, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Follow cleanup.h recommendations and define and assign a variable
> in one statement when __free() is used.
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> Zhang, I said the code structure here was intentional, but that was before
> the cleanup.h recommendation was pointed out to me.
> 
> ---
>  drivers/cpufreq/intel_pstate.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1502,9 +1502,7 @@ static void __intel_pstate_update_max_fr
>  
>  static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
>  {
> -	struct cpufreq_policy *policy __free(put_cpufreq_policy);
> -
> -	policy = cpufreq_cpu_get(cpudata->cpu);
> +	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
>  	if (!policy)
>  		return false;
>  
> 
> 

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] cpufreq: intel_pstate: Rearrange variable declaration involving __free()
  2025-09-04  4:15 ` Viresh Kumar
@ 2025-09-04  4:32   ` Zihuan Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Zihuan Zhang @ 2025-09-04  4:32 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J. Wysocki
  Cc: Linux PM, LKML, Krzysztof Kozlowski, Srinivas Pandruvada


> On 03-09-25, 16:59, Rafael J. Wysocki wrote:
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
>> Follow cleanup.h recommendations and define and assign a variable
>> in one statement when __free() is used.
>>
>> No intentional functional impact.
>>
>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> ---
>>
>> Zhang, I said the code structure here was intentional, but that was before
>> the cleanup.h recommendation was pointed out to me.
>>
>> ---
>>   drivers/cpufreq/intel_pstate.c |    4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> --- a/drivers/cpufreq/intel_pstate.c
>> +++ b/drivers/cpufreq/intel_pstate.c
>> @@ -1502,9 +1502,7 @@ static void __intel_pstate_update_max_fr
>>   
>>   static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
>>   {
>> -	struct cpufreq_policy *policy __free(put_cpufreq_policy);
>> -
>> -	policy = cpufreq_cpu_get(cpudata->cpu);
>> +	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
>>   	if (!policy)
>>   		return false;
>>   

Reviewed-by:   Zihuan Zhang <zhangzihuan@kylinos.cn>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-04  4:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-03 14:59 [PATCH v1] cpufreq: intel_pstate: Rearrange variable declaration involving __free() Rafael J. Wysocki
2025-09-03 15:08 ` Krzysztof Kozlowski
2025-09-04  4:15 ` Viresh Kumar
2025-09-04  4:32   ` Zihuan Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®