From: Krzysztof Kozlowski <krzk@kernel.org>
To: Zihuan Zhang <zhangzihuan@kylinos.cn>
Cc: airlied@gmail.com, alim.akhtar@samsung.com,
beata.michalska@arm.com, ben.horgan@arm.com, bp@alien8.de,
catalin.marinas@arm.com, cw00.choi@samsung.com,
daniel.lezcano@kernel.org, dave.hansen@linux.intel.com,
dri-devel@lists.freedesktop.org, edubezval@gmail.com,
festevam@gmail.com, imx@lists.linux.dev,
intel-gfx@lists.freedesktop.org, j-keerthy@ti.com,
jani.nikula@linux.intel.com, kernel@pengutronix.de,
kyungmin.park@samsung.com, lenb@kernel.org,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
lukasz.luba@arm.com, mpe@ellerman.id.au,
myungjoo.ham@samsung.com, pavel@kernel.org,
ptsm@linux.microsoft.com, rafael@kernel.org,
rodrigo.vivi@intel.com, rui.zhang@intel.com,
s.hauer@pengutronix.de, shawnguo@kernel.org, simona@ffwll.ch,
srinivas.pandruvada@linux.intel.com, sudeep.holla@arm.com,
sumitg@nvidia.com, thierry.reding@gmail.com,
tursulin@ursulin.net, viresh.kumar@linaro.org, will@kernel.org,
yangyicong@hisilicon.com, zhenglifeng1@huawei.com
Subject: Re: [PATCH v3 12/12] PM: EM: Use scope-based cleanup helper
Date: Wed, 3 Sep 2025 08:11:12 +0200 [thread overview]
Message-ID: <04ca5584-b10e-465d-bbda-627b7f743ce9@kernel.org> (raw)
In-Reply-To: <20250903021230.1044454-1-zhangzihuan@kylinos.cn>
On 03/09/2025 04:12, Zihuan Zhang wrote:
>> You are not improving the source code here. This is not how to use
>> __free() and you clearly do not understand the source code.
>
> Sorry for the problem, policy should be assigned after cpumask_test_cpu().
>
> I actually realized earlier that __free() only frees at the end of the variable’s lifetime.
> I had suggested using a braced macro in cpufreq.h to allow immediate release after use,
> but I understand the maintainer’s advice to “keep it simple” and will follow that.
>
>> What's more, you did not use standard tools which would tell you this is
>> buggy and wrong.
>
> Could you please let me know which standard tools you recommend for detecting such issues?
>
> I’d like to use them to avoid similar mistakes in the future.
All standard tools used for kernel development, sparse, smatch, clang,
coccinelle, see my talk from OSSE25.
Best regards,
Krzysztof
prev parent reply other threads:[~2025-09-03 6:11 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
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 [this message]
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=04ca5584-b10e-465d-bbda-627b7f743ce9@kernel.org \
--to=krzk@kernel.org \
--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=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=zhangzihuan@kylinos.cn \
--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;
as well as URLs for NNTP newsgroup(s).