Re: [patch V2 26/45] genirq/chip: Rework irq_set_handler() variants

Thomas Gleixner
2025-05-12T18:39:45Z

On Mon, May 12 2025 at 09:25, Jiri Slaby wrote:
> On 11. 05. 25, 19:49, Nathan Chancellor wrote:
>> {
>> - class_irqdesc_lock_t _t = {
>> - .bus = bus,
>> - .lock = __irq_get_desc_lock(irq, &_t.flags, bus, check),
>
> I assume the value stored by __irq_get_desc_lock() to &_t.flags is
> overwritten by 0 by the initializer. class_irqdesc_lock_t::flags is
> later than ::lock in the structure, so __irq_get_desc_lock() should be
> called, setting ::flags, then the initializer should set flags to 0.

That's what you'd assume. But indeed the compiler might decide that
flags is uninitialized and then overwrite it after the initialized
fields :(

Nathan, can you please send a patch with a proper change log?

Thanks,

tglx