@@ -1413,7 +1413,7 @@ int dev_open(struct net_device *dev)
14131413}
14141414EXPORT_SYMBOL (dev_open );
14151415
1416- static int __dev_close_many (struct list_head * head )
1416+ static void __dev_close_many (struct list_head * head )
14171417{
14181418 struct net_device * dev ;
14191419
@@ -1455,23 +1455,18 @@ static int __dev_close_many(struct list_head *head)
14551455 dev -> flags &= ~IFF_UP ;
14561456 netpoll_poll_enable (dev );
14571457 }
1458-
1459- return 0 ;
14601458}
14611459
1462- static int __dev_close (struct net_device * dev )
1460+ static void __dev_close (struct net_device * dev )
14631461{
1464- int retval ;
14651462 LIST_HEAD (single );
14661463
14671464 list_add (& dev -> close_list , & single );
1468- retval = __dev_close_many (& single );
1465+ __dev_close_many (& single );
14691466 list_del (& single );
1470-
1471- return retval ;
14721467}
14731468
1474- int dev_close_many (struct list_head * head , bool unlink )
1469+ void dev_close_many (struct list_head * head , bool unlink )
14751470{
14761471 struct net_device * dev , * tmp ;
14771472
@@ -1488,8 +1483,6 @@ int dev_close_many(struct list_head *head, bool unlink)
14881483 if (unlink )
14891484 list_del_init (& dev -> close_list );
14901485 }
1491-
1492- return 0 ;
14931486}
14941487EXPORT_SYMBOL (dev_close_many );
14951488
@@ -1502,7 +1495,7 @@ EXPORT_SYMBOL(dev_close_many);
15021495 * is then deactivated and finally a %NETDEV_DOWN is sent to the notifier
15031496 * chain.
15041497 */
1505- int dev_close (struct net_device * dev )
1498+ void dev_close (struct net_device * dev )
15061499{
15071500 if (dev -> flags & IFF_UP ) {
15081501 LIST_HEAD (single );
@@ -1511,7 +1504,6 @@ int dev_close(struct net_device *dev)
15111504 dev_close_many (& single , true);
15121505 list_del (& single );
15131506 }
1514- return 0 ;
15151507}
15161508EXPORT_SYMBOL (dev_close );
15171509
@@ -6725,8 +6717,12 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags)
67256717 */
67266718
67276719 ret = 0 ;
6728- if ((old_flags ^ flags ) & IFF_UP )
6729- ret = ((old_flags & IFF_UP ) ? __dev_close : __dev_open )(dev );
6720+ if ((old_flags ^ flags ) & IFF_UP ) {
6721+ if (old_flags & IFF_UP )
6722+ __dev_close (dev );
6723+ else
6724+ ret = __dev_open (dev );
6725+ }
67306726
67316727 if ((flags ^ dev -> gflags ) & IFF_PROMISC ) {
67326728 int inc = (flags & IFF_PROMISC ) ? 1 : -1 ;
0 commit comments