Commit 9280ac2e authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski

net: dev_replace_track() cleanup

Use existing helpers (netdev_tracker_free()
and netdev_tracker_alloc()) to remove ifdefery.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20211214151515.312535-1-eric.dumazet@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 123e495e
...@@ -3885,16 +3885,14 @@ static inline void dev_replace_track(struct net_device *odev, ...@@ -3885,16 +3885,14 @@ static inline void dev_replace_track(struct net_device *odev,
netdevice_tracker *tracker, netdevice_tracker *tracker,
gfp_t gfp) gfp_t gfp)
{ {
#ifdef CONFIG_NET_DEV_REFCNT_TRACKER
if (odev) if (odev)
ref_tracker_free(&odev->refcnt_tracker, tracker); netdev_tracker_free(odev, tracker);
#endif
dev_hold(ndev); dev_hold(ndev);
dev_put(odev); dev_put(odev);
#ifdef CONFIG_NET_DEV_REFCNT_TRACKER
if (ndev) if (ndev)
ref_tracker_alloc(&ndev->refcnt_tracker, tracker, gfp); netdev_tracker_alloc(ndev, tracker, gfp);
#endif
} }
/* Carrier loss detection, dial on demand. The functions netif_carrier_on /* Carrier loss detection, dial on demand. The functions netif_carrier_on
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment