From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Rosen Penev <rosenp@gmail.com>, linux-pm@vger.kernel.org
Cc: Georgi Djakov <djakov@kernel.org>, Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"open list:ARM/QUALCOMM MAILING LIST"
<linux-arm-msm@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
open "list:KERNEL" HARDENING "(not" covered by other
"areas):Keyword:b__counted_by(_le|_be|_ptr)?b"
<linux-hardening@vger.kernel.org>
Subject: Re: [PATCH] interconnect: qcom: simplify allocation
Date: Mon, 8 Jun 2026 10:58:21 +0200 [thread overview]
Message-ID: <9117ce31-2cc9-4f52-b223-fe0dacddcc65@oss.qualcomm.com> (raw)
In-Reply-To: <20260608050429.5990-1-rosenp@gmail.com>
On 6/8/26 7:04 AM, Rosen Penev wrote:
> Use a flexible array member to reduce allocation by 1.
>
> Add __counted_by for extra runtime analysis. Move counting variable
> assignment after allocation before any array access,
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
[...]
> diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h
> index 7d1cb2efa9ee..b08821c2ef74 100644
> --- a/drivers/interconnect/qcom/icc-rpm.h
> +++ b/drivers/interconnect/qcom/icc-rpm.h
> @@ -64,9 +64,9 @@ struct qcom_icc_provider {
> u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM];
> const struct rpm_clk_resource *bus_clk_desc;
> struct clk *bus_clk;
> - struct clk_bulk_data *intf_clks;
> bool keep_alive;
> bool ignore_enxio;
> + struct clk_bulk_data intf_clks[] __counted_by(num_intf_clks);
nit: it's easier to visually track if these are kept together. I think
you may also need to update the kerneldoc as the order changes
Konrad
prev parent reply other threads:[~2026-06-08 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 5:04 Rosen Penev
2026-06-08 6:36 ` Dmitry Baryshkov
2026-06-08 8:58 ` Konrad Dybcio [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=9117ce31-2cc9-4f52-b223-fe0dacddcc65@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=djakov@kernel.org \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rosenp@gmail.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
Powered by JetHome