From: Geliang Tang Date: Tue, 22 Dec 2015 15:11:49 +0000 (+0800) Subject: net-sysfs: use to_net_dev in net_namespace() X-Git-Tag: v4.9.8~2476^2~446 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c29482dd17835def5cb97918f8f83a881c9918a;p=platform%2Fkernel%2Flinux-rpi3.git net-sysfs: use to_net_dev in net_namespace() Use to_net_dev() instead of open-coding it. Signed-off-by: Geliang Tang Signed-off-by: David S. Miller --- diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index bca8c35..b6c8a66 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); }