Re: [PATCH net-next v2] netdevice: define and allocate &net_device _properly_

From: Eric Dumazet
Date: Thu Jul 11 2024 - 11:41:53 EST


On Thu, Jul 11, 2024 at 5:54 AM Alexander Lobakin
<aleksander.lobakin@xxxxxxxxx> wrote:
>
> From: Eric Dumazet <edumazet@xxxxxxxxxx>
> Date: Wed, 10 Jul 2024 10:04:39 -0700
>
> > This is because of the ‘const’ qualifier of the parameter.
> >
> > This could be solved with _Generic() later, if we want to keep the
> > const qualifier.
>
> I tried _Generic() when I was working on this patch and it seems like
> lots of drivers need to be fixed first. They pass a const &net_device,
> but assign the result to a non-const variable and modify fields there.
> That's why I bet up on this and just casted to (void *) for now.

Right, I will clean things up in the next cycle.