On 06.10.2026 07:59, Jan Beulich wrote: > On 05.10.2026 18:59, Roger Pau Monné wrote: >> On Wed, Sep 02, 2026 at 08:35:47AM +0200, Jan Beulich wrote: >>> While _set_status_v2() indeed doesn't alter the grant_entry_header_t it >>> is handed a pointer to, _set_status_v1() does. Drop the const from the >>> parameter of the latter (and then necessarily also from _set_status()'s), >>> while adding const to the local variable of the former. >>> >>> No functional change. >>> >>> Signed-off-by: Jan Beulich <[email protected]> >> >> Acked-by: Roger Pau Monné <[email protected]> > > Thanks. > >> Could we also use a union in the functions themselves to avoid the cast? >> >> union { >> const grant_entry_header_t *shah; >> uint32_t *raw; >> } grant = { .shah = shah }; > > Possibly. However, irrespective of us using such all over the place, it > still is - strictly speaking - UB.
Then again we already have union grant_combo, which may want leveraging here. Jan
