[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85c5e4b69dbb4ff699f380b373f6440f@AcuMS.aculab.com>
Date: Tue, 15 Aug 2023 11:19:50 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "'minyard@....org'" <minyard@....org>,
Justin Stitt <justinstitt@...gle.com>
CC: Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>,
"openipmi-developer@...ts.sourceforge.net"
<openipmi-developer@...ts.sourceforge.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"llvm@...ts.linux.dev" <llvm@...ts.linux.dev>,
Arnd Bergmann <arnd@...db.de>,
kernel test robot <lkp@...el.com>
Subject: RE: [PATCH] ipmi_si: fix -Wvoid-pointer-to-enum-cast warning
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)
Powered by blists - more mailing lists