Commit 9492f426 authored by David S. Miller's avatar David S. Miller

Merge branch 'dev_close-void'

Stephen Hemminger says:

====================
net: make dev_close void

Noticed while working on other changes. Why is dev_close()
returning int, it should be void.  Should also change
ndo_close to be void, but that requires more work and someone
with more coccinelle foo (smpl) than me.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents eb2b9874 7051b88a
...@@ -595,7 +595,7 @@ static void hns_nic_self_test(struct net_device *ndev, ...@@ -595,7 +595,7 @@ static void hns_nic_self_test(struct net_device *ndev,
set_bit(NIC_STATE_TESTING, &priv->state); set_bit(NIC_STATE_TESTING, &priv->state);
if (if_running) if (if_running)
(void)dev_close(ndev); dev_close(ndev);
for (i = 0; i < SELF_TEST_TPYE_NUM; i++) { for (i = 0; i < SELF_TEST_TPYE_NUM; i++) {
if (!st_param[i][1]) if (!st_param[i][1])
......
...@@ -2432,8 +2432,8 @@ struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); ...@@ -2432,8 +2432,8 @@ struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
struct net_device *__dev_get_by_name(struct net *net, const char *name); struct net_device *__dev_get_by_name(struct net *net, const char *name);
int dev_alloc_name(struct net_device *dev, const char *name); int dev_alloc_name(struct net_device *dev, const char *name);
int dev_open(struct net_device *dev); int dev_open(struct net_device *dev);
int dev_close(struct net_device *dev); void dev_close(struct net_device *dev);
int dev_close_many(struct list_head *head, bool unlink); void dev_close_many(struct list_head *head, bool unlink);
void dev_disable_lro(struct net_device *dev); void dev_disable_lro(struct net_device *dev);
int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb); int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb);
int dev_queue_xmit(struct sk_buff *skb); int dev_queue_xmit(struct sk_buff *skb);
......
...@@ -618,12 +618,8 @@ static void ifup(struct net_device *netdev) ...@@ -618,12 +618,8 @@ static void ifup(struct net_device *netdev)
static void ifdown(struct net_device *netdev) static void ifdown(struct net_device *netdev)
{ {
int err;
rtnl_lock(); rtnl_lock();
err = dev_close(netdev); dev_close(netdev);
if (err < 0)
BT_INFO("iface %s cannot be closed (%d)", netdev->name, err);
rtnl_unlock(); rtnl_unlock();
} }
......
...@@ -1413,7 +1413,7 @@ int dev_open(struct net_device *dev) ...@@ -1413,7 +1413,7 @@ int dev_open(struct net_device *dev)
} }
EXPORT_SYMBOL(dev_open); 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; struct net_device *dev;
...@@ -1455,23 +1455,18 @@ static int __dev_close_many(struct list_head *head) ...@@ -1455,23 +1455,18 @@ static int __dev_close_many(struct list_head *head)
dev->flags &= ~IFF_UP; dev->flags &= ~IFF_UP;
netpoll_poll_enable(dev); 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_HEAD(single);
list_add(&dev->close_list, &single); list_add(&dev->close_list, &single);
retval = __dev_close_many(&single); __dev_close_many(&single);
list_del(&single); list_del(&single);
return retval;
} }
int dev_close_many(struct list_head *head, bool unlink) void dev_close_many(struct list_head *head, bool unlink)
{ {
struct net_device *dev, *tmp; struct net_device *dev, *tmp;
...@@ -1488,8 +1483,6 @@ int dev_close_many(struct list_head *head, bool unlink) ...@@ -1488,8 +1483,6 @@ int dev_close_many(struct list_head *head, bool unlink)
if (unlink) if (unlink)
list_del_init(&dev->close_list); list_del_init(&dev->close_list);
} }
return 0;
} }
EXPORT_SYMBOL(dev_close_many); EXPORT_SYMBOL(dev_close_many);
...@@ -1502,7 +1495,7 @@ EXPORT_SYMBOL(dev_close_many); ...@@ -1502,7 +1495,7 @@ EXPORT_SYMBOL(dev_close_many);
* is then deactivated and finally a %NETDEV_DOWN is sent to the notifier * is then deactivated and finally a %NETDEV_DOWN is sent to the notifier
* chain. * chain.
*/ */
int dev_close(struct net_device *dev) void dev_close(struct net_device *dev)
{ {
if (dev->flags & IFF_UP) { if (dev->flags & IFF_UP) {
LIST_HEAD(single); LIST_HEAD(single);
...@@ -1511,7 +1504,6 @@ int dev_close(struct net_device *dev) ...@@ -1511,7 +1504,6 @@ int dev_close(struct net_device *dev)
dev_close_many(&single, true); dev_close_many(&single, true);
list_del(&single); list_del(&single);
} }
return 0;
} }
EXPORT_SYMBOL(dev_close); EXPORT_SYMBOL(dev_close);
...@@ -6725,8 +6717,12 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags) ...@@ -6725,8 +6717,12 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags)
*/ */
ret = 0; ret = 0;
if ((old_flags ^ flags) & IFF_UP) 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) { if ((flags ^ dev->gflags) & IFF_PROMISC) {
int inc = (flags & IFF_PROMISC) ? 1 : -1; int inc = (flags & IFF_PROMISC) ? 1 : -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment