Explorar o código

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>
Geliang Tang %!s(int64=10) %!d(string=hai) anos
pai
achega
5c29482dd1
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      net/core/net-sysfs.c

+ 2 - 2
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);
 }