Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1296825 > unrolled thread

[PATCH] net-sysfs: use to_net_dev in net_namespace()

Started byGeliang Tang <geliangtang@163.com>
First post2015-12-22 16:20 +0100
Last post2015-12-22 21:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net-sysfs: use to_net_dev in net_namespace() Geliang Tang <geliangtang@163.com> - 2015-12-22 16:20 +0100
    Re: [PATCH] net-sysfs: use to_net_dev in net_namespace() David Miller <davem@davemloft.net> - 2015-12-22 21:10 +0100

#1296825 — [PATCH] net-sysfs: use to_net_dev in net_namespace()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-22 16:20 +0100
Subject[PATCH] net-sysfs: use to_net_dev in net_namespace()
Message-ID<qIwTg-5Bi-7@gated-at.bofh.it>
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1297039

FromDavid Miller <davem@davemloft.net>
Date2015-12-22 21:10 +0100
Message-ID<qIBpU-8vR-13@gated-at.bofh.it>
In reply to#1296825
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web