Re: [PATCH v2 1/1] scsi: qla2xxx: replace non-standard flexible array purex_item.iocb

Gustavo A. R. Silva
2025-07-30T01:33:33Z

On 29/07/25 18:04, Chris Leech wrote:
> On Mon, Jul 28, 2025 at 08:20:12PM -0600, Gustavo A. R. Silva wrote:
>>
>> I just noticed that the new TRAILING_OVERLAP() helper just landed in
>> Linus' tree, and this issue seems to be a perfect candidate for it.
>>
>> The (untested) patch below avoids the use of `struct_group_tagged()`
>> and the casts to `struct purex_item *`:
>
> (I was largely basing my use of struct_group on your blog post from a
> few month back, but now there's another new macro!)

Yep, the kernel is constantly evolving. :)

I'm actually writing a follow up post (and a presentation for OSSEU)
where I'll share updates on enabling -Wflex-array-member-not-at-end,
including details about this new helper.

>
> Yes, that looks like it would work as long as the driver maintainer
> doesn't object to moving that field around in scsi_qla_host.
>
> I'm getting ready to be away from the computer for a week, so I have to
> leave this for now. Maybe Nilesh has an opinion?

No worries, I can take it up from here.

Thanks!
-Gustavo