Re: [PATCH v3] cxl/events: Use a common struct for DRAM and General Media events

From: Dan Williams
Date: Mon May 20 2024 - 19:14:18 EST


Fabio M. De Francesco wrote:
> On Monday, May 20, 2024 7:55:17 PM GMT+2 Fabio M. De Francesco wrote:
> > On Saturday, May 18, 2024 1:26:21 PM GMT+2 Fabio M. De Francesco wrote:
> > [...]
> I suspect that I didn't clarify that the diff above is proposing an additional
> little change to this patch (for v4) and that I wanted to collect comments
> before applying and respinning.
>
> To be clearer, that diff is meant only to show that cxl_event_media_hdr can be
> removed from union cxl_event at no cost while still be used for the common
> fields in the definitions of cxl_event_dram and cxl_event_gen_media.

I agree with Alison, this is what a union is for, and more generally,
runtime code should never be added to make up for deficiencies in the data
structure.