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 <[email protected]>
> ---

[...]

> 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

Reply via email to