Re: [PATCHv3] ata: ahci_tegra: use devm_kzalloc_flex()
From: Niklas Cassel
Date: Wed Nov 11 2026 - 03:42:24 EST
Hello Rosen,
On Tue, Nov 10, 2026 at 06:39:39PM -0800, Rosen Penev wrote:
> Combine allocations into one by using a flexible array member.
Thanks for adding the comment and fixing the subject.
However, the commit log still does not explain the benefit, so my
reply to V2 still applies:
https://lore.kernel.org/linux-ide/ah1HD1aOyTnMBEqD@ryzen/
A flexible array member also has disadvantages: nothing can be added
after it, and there can be only one per struct.
If we use one anyway, it should be annotated with __counted_by(), as
Damien and I asked for in V1. devm_kzalloc_flex() calls
__set_flex_counter(), so that should mostly be a matter of adding a
counter member.
Since neither Jon nor I am a fan of this change, I will only apply a
V4 if Jon explicitly asks for it.
Kind regards,
Niklas