netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: Linux Netdev List <netdev@vger.kernel.org>
Subject: [RFC][PATCH 3/3] Move net_device->uninit callback on net_device_ops.
Date: Fri, 04 Apr 2008 18:14:36 +0400	[thread overview]
Message-ID: <47F637CC.30500@openvz.org> (raw)
In-Reply-To: <47F63681.1030603@openvz.org>

The void calls are even simpler.

Plus ~18 more patches and all the ops will be moved on the
net_device_ops and it will be possible to start converting
device drivers...

So, what is your opinion about all this?

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 net/core/dev.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index a01c078..3428534 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3644,8 +3644,8 @@ static void rollback_registered(struct net_device *dev)
 	 */
 	dev_addr_discard(dev);
 
-	if (dev->uninit)
-		dev->uninit(dev);
+	if (dev->nd_ops->uninit)
+		dev->nd_ops->uninit(dev);
 
 	/* Notifier chain MUST detach us from master device. */
 	BUG_TRAP(!dev->master);
@@ -3804,8 +3804,8 @@ out:
 	return ret;
 
 err_uninit:
-	if (dev->uninit)
-		dev->uninit(dev);
+	if (dev->nd_ops->uninit)
+		dev->nd_ops->uninit(dev);
 	goto out;
 }
 
@@ -3988,8 +3988,15 @@ static int nd_default_init(struct net_device *dev)
 		return 0;
 }
 
+static void nd_default_uninit(struct net_device *dev)
+{
+	if (dev->uninit)
+		dev->uninit(dev);
+}
+
 static struct net_device_ops nd_default_ops = {
 	.init			= nd_default_init,
+	.uninit			= nd_default_uninit,
 };
 
 /**
-- 
1.5.3.4


      parent reply	other threads:[~2008-04-04 13:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 14:09 [RFC][PATCH 0/3] Make loopback device weight twice as little Pavel Emelyanov
2008-04-04 14:10 ` [RFC][PATCH 1/3] Introduce the net_device_ops structure Pavel Emelyanov
2008-04-04 15:14   ` Stephen Hemminger
2008-04-04 15:54     ` Patrick McHardy
2008-04-14  4:20       ` David Miller
2008-04-04 14:12 ` [RFC][PATCH 2/3] Move net_device->init callback on net_device_ops Pavel Emelyanov
2008-04-04 14:14 ` Pavel Emelyanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47F637CC.30500@openvz.org \
    --to=xemul@openvz.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).