Commit 5c29482d authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

net-sysfs: use to_net_dev in net_namespace()

Use to_net_dev() instead of open-coding it.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d317aa58
...@@ -1453,8 +1453,8 @@ static void netdev_release(struct device *d) ...@@ -1453,8 +1453,8 @@ static void netdev_release(struct device *d)
static const void *net_namespace(struct device *d) static const void *net_namespace(struct device *d)
{ {
struct net_device *dev; struct net_device *dev = to_net_dev(d);
dev = container_of(d, struct net_device, dev);
return dev_net(dev); return dev_net(dev);
} }
......
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