Re: Is casting a void ptr to something else considered bad kernel coding style

From: Dan Carpenter
Date: Fri Jul 15 2022 - 04:15:55 EST


On Thu, Jul 14, 2022 at 05:00:19PM -0500, Steve French wrote:
> For examples like this where a pointer which is (void *) is cast to
> something else, is this considered bad coding style in kernel C
> programming?
>
> It may be that leaving the (unnecessary) cast in, although it is not
> required for C, makes the code clearer in some cases.
>
> Any opinions on changes to remove casts of void pointers for kernel
> code (which I have recently seen suggested)?
>

Pointless casts are bad, but the churn is bad too...

regards,
dan carpenter