diff options
author | dingtianhong <dingtianhong@huawei.com> | 2013-05-27 15:53:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-28 02:18:50 -0400 |
commit | da6e378ba918cd0feeb90eeb84d8b42148bb0c82 (patch) | |
tree | 7ffc6e756d49f67205b5e05d3284d81cda06cc7a /net/core | |
parent | 87227b8b2d4d556a6924ad9af87450fdc3fcd7e3 (diff) |
netpoll: remove return value from netpoll_rx_disable()
The netpoll_rx_disable() will always return 0, it is no use and looks wordy,
so remove the unnecessary code and get rid of it in _dev_open and _dev_close.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 15 | ||||
-rw-r--r-- | net/core/netpoll.c | 3 |
2 files changed, 5 insertions, 13 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 2f09cb29cc95..5f747974ac58 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1198,9 +1198,7 @@ static int __dev_open(struct net_device *dev) | |||
1198 | * If we don't do this there is a chance ndo_poll_controller | 1198 | * If we don't do this there is a chance ndo_poll_controller |
1199 | * or ndo_poll may be running while we open the device | 1199 | * or ndo_poll may be running while we open the device |
1200 | */ | 1200 | */ |
1201 | ret = netpoll_rx_disable(dev); | 1201 | netpoll_rx_disable(dev); |
1202 | if (ret) | ||
1203 | return ret; | ||
1204 | 1202 | ||
1205 | ret = call_netdevice_notifiers(NETDEV_PRE_UP, dev); | 1203 | ret = call_netdevice_notifiers(NETDEV_PRE_UP, dev); |
1206 | ret = notifier_to_errno(ret); | 1204 | ret = notifier_to_errno(ret); |
@@ -1309,9 +1307,7 @@ static int __dev_close(struct net_device *dev) | |||
1309 | LIST_HEAD(single); | 1307 | LIST_HEAD(single); |
1310 | 1308 | ||
1311 | /* Temporarily disable netpoll until the interface is down */ | 1309 | /* Temporarily disable netpoll until the interface is down */ |
1312 | retval = netpoll_rx_disable(dev); | 1310 | netpoll_rx_disable(dev); |
1313 | if (retval) | ||
1314 | return retval; | ||
1315 | 1311 | ||
1316 | list_add(&dev->unreg_list, &single); | 1312 | list_add(&dev->unreg_list, &single); |
1317 | retval = __dev_close_many(&single); | 1313 | retval = __dev_close_many(&single); |
@@ -1353,14 +1349,11 @@ static int dev_close_many(struct list_head *head) | |||
1353 | */ | 1349 | */ |
1354 | int dev_close(struct net_device *dev) | 1350 | int dev_close(struct net_device *dev) |
1355 | { | 1351 | { |
1356 | int ret = 0; | ||
1357 | if (dev->flags & IFF_UP) { | 1352 | if (dev->flags & IFF_UP) { |
1358 | LIST_HEAD(single); | 1353 | LIST_HEAD(single); |
1359 | 1354 | ||
1360 | /* Block netpoll rx while the interface is going down */ | 1355 | /* Block netpoll rx while the interface is going down */ |
1361 | ret = netpoll_rx_disable(dev); | 1356 | netpoll_rx_disable(dev); |
1362 | if (ret) | ||
1363 | return ret; | ||
1364 | 1357 | ||
1365 | list_add(&dev->unreg_list, &single); | 1358 | list_add(&dev->unreg_list, &single); |
1366 | dev_close_many(&single); | 1359 | dev_close_many(&single); |
@@ -1368,7 +1361,7 @@ int dev_close(struct net_device *dev) | |||
1368 | 1361 | ||
1369 | netpoll_rx_enable(dev); | 1362 | netpoll_rx_enable(dev); |
1370 | } | 1363 | } |
1371 | return ret; | 1364 | return 0; |
1372 | } | 1365 | } |
1373 | EXPORT_SYMBOL(dev_close); | 1366 | EXPORT_SYMBOL(dev_close); |
1374 | 1367 | ||
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index cec074be8c43..37deedd48bcc 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -247,7 +247,7 @@ static void netpoll_poll_dev(struct net_device *dev) | |||
247 | zap_completion_queue(); | 247 | zap_completion_queue(); |
248 | } | 248 | } |
249 | 249 | ||
250 | int netpoll_rx_disable(struct net_device *dev) | 250 | void netpoll_rx_disable(struct net_device *dev) |
251 | { | 251 | { |
252 | struct netpoll_info *ni; | 252 | struct netpoll_info *ni; |
253 | int idx; | 253 | int idx; |
@@ -257,7 +257,6 @@ int netpoll_rx_disable(struct net_device *dev) | |||
257 | if (ni) | 257 | if (ni) |
258 | down(&ni->dev_lock); | 258 | down(&ni->dev_lock); |
259 | srcu_read_unlock(&netpoll_srcu, idx); | 259 | srcu_read_unlock(&netpoll_srcu, idx); |
260 | return 0; | ||
261 | } | 260 | } |
262 | EXPORT_SYMBOL(netpoll_rx_disable); | 261 | EXPORT_SYMBOL(netpoll_rx_disable); |
263 | 262 | ||