RE: [PATCH] ipmi_si: fix -Wvoid-pointer-to-enum-cast warning

From: David Laight
Date: Tue Aug 15 2023 - 07:20:55 EST


From: Corey Minyard
> Sent: 11 August 2023 21:27
...
> > memset(&io, 0, sizeof(io));
> > - io.si_type = (enum si_type) match->data;
> > + io.si_type = (unsigned long) match->data;
>
> Wouldn't you want to use intptr_t or uintptr_t?

The kernel tends to use 'long' for the same reason
it doesn't use uint8_t.

Although I'm sure the correct/better fix is to either add variants
of the match/lookup functions that return (say) unsigned long
or change all the drivers to allocate a structure that contains
the required value.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)