From: Allen Pais <allen.l...@gmail.com> Date: Wed, 9 Sep 2020 14:14:51 +0530
> @@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, > unsigned int txqueue) > } > > > -static void ace_tasklet(unsigned long arg) > +static void ace_tasklet(struct tasklet_struct *t) > { > - struct net_device *dev = (struct net_device *) arg; > - struct ace_private *ap = netdev_priv(dev); > + struct ace_private *ap = from_tasklet(ap, t, ace_tasklet); > + struct net_device *dev = (struct net_device *)((char *)ap - > + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); > int cur_size; > I don't see this is as an improvement. The 'dev' assignment looks so incredibly fragile and exposes so many internal details about netdev object allocation, alignment, and layout. Who is going to find and fix this if someone changes how netdev object allocation works? I don't want to apply this, it sets a very bad precedent. The existing code is so much cleaner and easier to understand and audit.