mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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>
This commit is contained in:
parent
d317aa5893
commit
5c29482dd1
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue