summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-22 23:11:49 +0800
committerDavid S. Miller <davem@davemloft.net>2015-12-22 15:04:09 -0500
commit5c29482dd17835def5cb97918f8f83a881c9918a (patch)
tree2f855653dab44427e11f609b5f88b995abb03e27 /net
parentd317aa5893015d473c11a55bc3125ebd68648946 (diff)
downloadlinux-5c29482dd17835def5cb97918f8f83a881c9918a.tar.bz2
net-sysfs: use to_net_dev in net_namespace()
Use to_net_dev() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/net-sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index bca8c350e7f3..b6c8a6629b39 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1453,8 +1453,8 @@ static void netdev_release(struct device *d)
static const void *net_namespace(struct device *d)
{
- struct net_device *dev;
- dev = container_of(d, struct net_device, dev);
+ struct net_device *dev = to_net_dev(d);
+
return dev_net(dev);
}