[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <611ae0d4d819f57c4d0c67afa8ed58b16c7d102a.1402926490.git.panweiping3@gmail.com>
Date: Mon, 16 Jun 2014 21:57:23 +0800
From: Weiping Pan <panweiping3@...il.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, Weiping Pan <panweiping3@...il.com>
Subject: [PATCH net 2/2] net: make some functions return void
dev_close_many(), __dev_close_many() and __dev_close() do not need to return a
int, so make them return void, and modify __dev_change_flags() accordingly.
Signed-off-by: Weiping Pan <panweiping3@...il.com>
---
net/core/dev.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index a04b12f..44d4748 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1305,7 +1305,7 @@ int dev_open(struct net_device *dev)
}
EXPORT_SYMBOL(dev_open);
-static int __dev_close_many(struct list_head *head)
+static void __dev_close_many(struct list_head *head)
{
struct net_device *dev;
@@ -1348,23 +1348,18 @@ static int __dev_close_many(struct list_head *head)
net_dmaengine_put();
netpoll_poll_enable(dev);
}
-
- return 0;
}
-static int __dev_close(struct net_device *dev)
+static void __dev_close(struct net_device *dev)
{
- int retval;
LIST_HEAD(single);
list_add(&dev->close_list, &single);
- retval = __dev_close_many(&single);
+ __dev_close_many(&single);
list_del(&single);
-
- return retval;
}
-static int dev_close_many(struct list_head *head)
+static void dev_close_many(struct list_head *head)
{
struct net_device *dev, *tmp;
@@ -1380,8 +1375,6 @@ static int dev_close_many(struct list_head *head)
call_netdevice_notifiers(NETDEV_DOWN, dev);
list_del_init(&dev->close_list);
}
-
- return 0;
}
/**
@@ -5433,7 +5426,10 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags)
ret = 0;
if ((old_flags ^ flags) & IFF_UP)
- ret = ((old_flags & IFF_UP) ? __dev_close : __dev_open)(dev);
+ if (old_flags & IFF_UP)
+ __dev_close(dev);
+ else
+ ret = __dev_open(dev);
if ((flags ^ dev->gflags) & IFF_PROMISC) {
int inc = (flags & IFF_PROMISC) ? 1 : -1;
--
1.9.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists