From: Zihuan Zhang <zhangzihuan@kylinos.cn>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Krzysztof Kozlowski <krzk@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Thierry Reding <thierry.reding@gmail.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>,
Eduardo Valentin <edubezval@gmail.com>,
Keerthy <j-keerthy@ti.com>, Ben Horgan <ben.horgan@arm.com>,
zhenglifeng <zhenglifeng1@huawei.com>,
Zhang Rui <rui.zhang@intel.com>, Len Brown <lenb@kernel.org>,
Lukasz Luba <lukasz.luba@arm.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Beata Michalska <beata.michalska@arm.com>,
Fabio Estevam <festevam@gmail.com>,
Pavel Machek <pavel@kernel.org>, Sumit Gupta <sumitg@nvidia.com>,
Prasanna Kumar T S M <ptsm@linux.microsoft.com>,
Sudeep Holla <sudeep.holla@arm.com>,
Yicong Yang <yangyicong@hisilicon.com>,
linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
imx@lists.linux.dev, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper
Date: Wed, 3 Sep 2025 08:51:06 +0800 [thread overview]
Message-ID: <40706b1f-e23c-417b-b3e1-2dc839828588@kylinos.cn> (raw)
In-Reply-To: <CAJZ5v0jvOKeLRkjWoKR5eVKZ-hib7c8D-VOBvtCvs1+HGfPUiQ@mail.gmail.com>
在 2025/9/2 19:47, Rafael J. Wysocki 写道:
> On Tue, Sep 2, 2025 at 12:33 PM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>>
>> 在 2025/9/1 23:17, Rafael J. Wysocki 写道:
>>> On Mon, Sep 1, 2025 at 10:58 AM Zihuan Zhang <zhangzihuan@kylinos.cn> wrote:
>>>> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
>>>> annotation for policy references. This reduces the risk of reference
>>>> counting mistakes and aligns the code with the latest kernel style.
>>>>
>>>> No functional change intended.
>>>>
>>>> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
>>>> ---
>>>> drivers/cpufreq/intel_pstate.c | 8 +++-----
>>>> 1 file changed, 3 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
>>>> index f366d35c5840..4abc1ef2d2b0 100644
>>>> --- a/drivers/cpufreq/intel_pstate.c
>>>> +++ b/drivers/cpufreq/intel_pstate.c
>>>> @@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
>>>>
>>>> static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
>>>> {
>>>> - struct cpufreq_policy *policy __free(put_cpufreq_policy);
>>>> + struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
>>>>
>>>> - policy = cpufreq_cpu_get(cpudata->cpu);
>>>> if (!policy)
>>>> return false;
>>> The structure of the code is intentional here and there's no reason to
>>> change it.
>>
>> Got it. Thanks for clarifying.
>>
>> So for this case the current structure is intentional -
> Note that I'm talking about this particular change only. The other
> change in the $subject patch is fine.
>
>> should I also avoid similar changes in other drivers?
> That depends on who maintains them, which is why I wanted you to split
> the patch into smaller changes in the first place.
>
> My personal view is that code formatting changes, which effectively is
> what this particular one is, are pointless unless they make the code
> much easier to follow.
UnderStood, Thanks!
next prev parent reply other threads:[~2025-09-03 0:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 8:57 [PATCH v3 00/12] cpufreq: use __free() for all cpufreq_cpu_get() references Zihuan Zhang
2025-09-01 8:57 ` [PATCH v3 01/12] arm64: topology: Use scope-based cleanup helper Zihuan Zhang
2025-09-01 8:57 ` [PATCH v3 02/12] ACPI: processor: thermal: " Zihuan Zhang
2025-09-03 11:07 ` Rafael J. Wysocki
2025-09-01 8:57 ` [PATCH v3 03/12] cpufreq: intel_pstate: " Zihuan Zhang
2025-09-01 15:17 ` Rafael J. Wysocki
2025-09-02 10:32 ` Zihuan Zhang
2025-09-02 11:47 ` Rafael J. Wysocki
2025-09-03 0:51 ` Zihuan Zhang [this message]
2025-09-03 11:04 ` Rafael J. Wysocki
2025-09-01 8:57 ` [PATCH v3 04/12] cpufreq: longhaul: " Zihuan Zhang
2025-09-02 15:58 ` Krzysztof Kozlowski
2025-09-01 8:57 ` [PATCH v3 05/12] cpufreq: powernv: " Zihuan Zhang
2025-09-01 8:57 ` [PATCH v3 06/12] PM / devfreq: " Zihuan Zhang
2025-09-01 8:57 ` [PATCH v3 07/12] drm/i915: " Zihuan Zhang
2025-09-01 8:57 ` [PATCH v3 08/12] cpufreq: powerpc: macintosh: " Zihuan Zhang
2025-09-02 15:59 ` Krzysztof Kozlowski
2025-09-01 8:57 ` [PATCH v3 09/12] powercap: dtpm_cpu: " Zihuan Zhang
2025-09-03 11:43 ` Rafael J. Wysocki
2025-09-01 8:57 ` [PATCH v3 10/12] thermal: imx: " Zihuan Zhang
2025-09-01 8:57 ` [PATCH v3 11/12] thermal/drivers/ti-soc-thermal: " Zihuan Zhang
2025-09-01 8:57 ` [PATCH v3 12/12] PM: EM: " Zihuan Zhang
2025-09-02 15:57 ` Krzysztof Kozlowski
2025-09-03 2:12 ` Zihuan Zhang
2025-09-03 6:11 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40706b1f-e23c-417b-b3e1-2dc839828588@kylinos.cn \
--to=zhangzihuan@kylinos.cn \
--cc=airlied@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=beata.michalska@arm.com \
--cc=ben.horgan@arm.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=cw00.choi@samsung.com \
--cc=daniel.lezcano@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=edubezval@gmail.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=intel-gfx@lists.freedesktop.org \
--cc=j-keerthy@ti.com \
--cc=jani.nikula@linux.intel.com \
--cc=kernel@pengutronix.de \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lukasz.luba@arm.com \
--cc=mpe@ellerman.id.au \
--cc=myungjoo.ham@samsung.com \
--cc=pavel@kernel.org \
--cc=ptsm@linux.microsoft.com \
--cc=rafael@kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=rui.zhang@intel.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=simona@ffwll.ch \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=sudeep.holla@arm.com \
--cc=sumitg@nvidia.com \
--cc=thierry.reding@gmail.com \
--cc=tursulin@ursulin.net \
--cc=viresh.kumar@linaro.org \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
--cc=zhenglifeng1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®