ipoib: move destructor to struct neigh_parms
PATCH 1/1 ipoib: move destructor to struct neigh_parms
Move destructor from neigh_ops (which is shared between devices) to neigh_parms which is not, so that multiple drivers can set it safely.
Signed-off-by Michael S. Tsirkin <[email protected]>
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -15
@@ -247,7 +247,6 @@ static void path_free(struct net_deviceif (neigh->ah)ipoib_put_ah (neigh->ah); *to_ipoib_neigh (neigh->neighbour) =NULL ; - neigh->neighbour->ops->destructor =NULL ;kfree (neigh); }
@@ -530,7 +529,6 @@ static void neigh_add_path(struct sk_buf err: *to_ipoib_neigh (skb->dst->neighbour) =NULL ;list_del (&neigh->list); - neigh->neighbour->ops->destructor =NULL ;kfree (neigh); ++priv->stats.tx_dropped;
@@ -769,21 +767,9 @@ static void ipoib_neigh_destructor(strucipoib_put_ah (ah); } -static int ipoib_neigh_setup (struct neighbour *neigh) -{ -/* -* Is this kosher? I can't find anybody in the kernel that -* sets neigh->destructor, so we should be able to set it here -* without trouble. -*/ - neigh->ops->destructor = ipoib_neigh_destructor; - -return 0 ; -} -static int ipoib_neigh_setup_dev (struct net_device *dev,struct neigh_parms *parms) { - parms->neigh_setup = ipoib_neigh_setup; + parms->neigh_destructor = ipoib_neigh_destructor;return 0 ; }
Signature · 1 line
MST