* [PATCH] net-sysfs: use to_net_dev in net_namespace()
@ 2015-12-22 15:11 Geliang Tang
2015-12-22 20:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2015-12-22 15:11 UTC (permalink / raw)
To: David S. Miller, Scott Feldman, Jiri Pirko
Cc: Geliang Tang, netdev, linux-kernel
Use to_net_dev() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
net/core/net-sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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);
}
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net-sysfs: use to_net_dev in net_namespace()
2015-12-22 15:11 [PATCH] net-sysfs: use to_net_dev in net_namespace() Geliang Tang
@ 2015-12-22 20:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-12-22 20:04 UTC (permalink / raw)
To: geliangtang; +Cc: sfeldma, jiri, netdev, linux-kernel
From: Geliang Tang <geliangtang@163.com>
Date: Tue, 22 Dec 2015 23:11:49 +0800
> Use to_net_dev() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-22 20:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-22 15:11 [PATCH] net-sysfs: use to_net_dev in net_namespace() Geliang Tang
2015-12-22 20:04 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).