bridge: cleanup netpoll code
Subsystems (5)
PATCH 1/3 bridge: cleanup netpoll code
This started out with fixing a sparse warning, then I realized that the wrapper function br_netpoll_info could just be collapsed away by rolling it into the enable code.
Also, eliminate unnecessary goto's
net/bridge/br_private.h +0 -10
@@ -333,11 +333,6 @@ extern void br_dev_delete(struct net_devextern netdev_tx_t br_dev_xmit (struct sk_buff *skb,struct net_device *dev);#ifdef CONFIG_NET_POLL_CONTROLLER -static inline struct netpoll_info *br_netpoll_info (struct net_bridge *br) -{ -return br->dev->npinfo; -} -static inline void br_netpoll_send_skb (const struct net_bridge_port *p,struct sk_buff *skb) {
@@ -350,11 +345,6 @@ static inline void br_netpoll_send_skb(cextern int br_netpoll_enable (struct net_bridge_port *p,gfp_t gfp);extern void br_netpoll_disable (struct net_bridge_port *p);#else -static inline struct netpoll_info *br_netpoll_info (struct net_bridge *br) -{ -return NULL ; -} -static inline void br_netpoll_send_skb (const struct net_bridge_port *p,struct sk_buff *skb) {
net/bridge/br_device.c +6 -6
@@ -244,22 +244,22 @@ fail:int br_netpoll_enable (struct net_bridge_port *p,gfp_t gfp) {struct netpoll *np; -int err =0 ; +int err; + +if (!p->br->dev->npinfo) +return 0 ; np =kzalloc (sizeof (*p->np), gfp); - err = -ENOMEM ;if (!np) - goto out; +return -ENOMEM ; err =__netpoll_setup (np, p->dev, gfp);if (err) {kfree (np); - goto out; +return err; } p->np = np; - -out:return err; }
net/bridge/br_if.c +2 -1
@@ -363,7 +363,8 @@ int br_add_if(struct net_bridge *br, strif (err) goto err2; -if (br_netpoll_info (br) && ((err =br_netpoll_enable (p,GFP_KERNEL )))) + err =br_netpoll_enable (p,GFP_KERNEL ); +if (err) goto err3; err =netdev_master_upper_dev_link (dev, br->dev);
PATCH 2/3 team: cleanup netpoll clode
This started out with fixing a sparse warning, then I realized that the wrapper function team_netpoll_info could just be collapsed away by rolling it into the enable code.
drivers/net/team/team.c +8 -17
@@ -1037,6 +1037,9 @@ static int team_port_enable_netpoll(strustruct netpoll *np;int err; +if (!team->dev->npinfo) +return 0 ; + np =kzalloc (sizeof (*np), gfp);if (!np)return -ENOMEM ;
@@ -1063,12 +1066,6 @@ static void team_port_disable_netpoll(st__netpoll_cleanup (np); kfree(np); } - -static struct netpoll_info *team_netpoll_info (struct team *team) -{ -return team->dev->npinfo; -} -#else static int team_port_enable_netpoll (struct team *team,struct team_port *port,gfp_t gfp)
@@ -1078,10 +1075,6 @@ static int team_port_enable_netpoll(strustatic void team_port_disable_netpoll (struct team_port *port) { } -static struct netpoll_info *team_netpoll_info (struct team *team) -{ -return NULL ; -}#endif static void __team_port_change_port_added (struct team_port *port,bool linkup);
@@ -1163,13 +1156,11 @@ static int team_port_add(struct team *te goto err_vids_add; } -if (team_netpoll_info (team)) { - err =team_port_enable_netpoll (team, port,GFP_KERNEL ); -if (err) { -netdev_err (dev,"Failed to enable netpoll on device %s\n" , - portname); - goto err_enable_netpoll; - } + err =team_port_enable_netpoll (team, port,GFP_KERNEL ); +if (err) { +netdev_err (dev,"Failed to enable netpoll on device %s\n" , + portname); + goto err_enable_netpoll; } err =netdev_master_upper_dev_link (port_dev, dev);
Re: [PATCH 2/3 net-next] team: cleanup netpoll clode
Quoted 5 lines · Wed, Jul 24, 2013 at 08:52:44PM CEST, [email protected] wrote:
This started out with fixing a sparse warning, then I realized that the wrapper function
team_netpoll_infocould just be collapsed away by rolling it into the enable code.Signed-off-by Stephen Hemminger <[email protected]>
Re: [PATCH 2/3 net-next] team: cleanup netpoll clode
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Wed, 24 Jul 2013 11:52:44 -0700
Quoted 5 lines
This started out with fixing a sparse warning, then I realized that the wrapper function
team_netpoll_infocould just be collapsed away by rolling it into the enable code.Signed-off-by Stephen Hemminger <[email protected]>
Applied.
PATCH 3/3 bond: cleanup netpoll code
In reply to Stephen HemmingerThis started out with fixing a sparse warning, then I realized that the wrapper function bond_netpoll_info could just be removed by rolling it into the enable code.
drivers/net/bonding/bond_main.c +1 -7
@@ -1254,12 +1254,6 @@ static int bond_netpoll_setup(struct netread_unlock (&bond->lock); return err; } - -static struct netpoll_info *bond_netpoll_info (struct bonding *bond) -{ -return bond->dev->npinfo; -} -#else static inline int slave_enable_netpoll (struct slave *slave) {
@@ -1804,7 +1798,7 @@ int bond_enslave(struct net_device *bondbond_set_carrier (bond);#ifdef CONFIG_NET_POLL_CONTROLLER - slave_dev->npinfo =bond_netpoll_info (bond); + slave_dev->npinfo = bond->dev->npinfo;if (slave_dev->npinfo) {if (slave_enable_netpoll (new_slave)) {read_unlock (&bond->lock);
Re: [PATCH 3/3 net-next] bond: cleanup netpoll code
Quoted 5 lines · Wed, Jul 24, 2013 at 08:53:57PM CEST, [email protected] wrote:
This started out with fixing a sparse warning, then I realized that the wrapper function
bond_netpoll_infocould just be removed by rolling it into the enable code.Signed-off-by Stephen Hemminger <[email protected]>
Re: [PATCH 3/3 net-next] bond: cleanup netpoll code
In reply to Stephen HemmingerQuoted 6 lines · Stephen Hemminger
This started out with fixing a sparse warning, then I realized that the wrapper function
bond_netpoll_infocould just be removed by rolling it into the enable code.Signed-off-by Stephen Hemminger <[email protected]>
Re: [PATCH 3/3 net-next] bond: cleanup netpoll code
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Wed, 24 Jul 2013 11:53:57 -0700
Quoted 5 lines
This started out with fixing a sparse warning, then I realized that the wrapper function
bond_netpoll_infocould just be removed by rolling it into the enable code.Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Quoted 7 lines · Wed, Jul 24, 2013 at 08:51:41PM CEST, [email protected] wrote:
This started out with fixing a sparse warning, then I realized that the wrapper function
br_netpoll_infocould just be collapsed away by rolling it into the enable code.Also, eliminate unnecessary goto's
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 8 lines · Stephen Hemminger
This started out with fixing a sparse warning, then I realized that the wrapper function
br_netpoll_infocould just be collapsed away by rolling it into the enable code.Also, eliminate unnecessary goto's
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 1 line
From: Stephen Hemminger <[email protected]>
Date: Wed, 24 Jul 2013 11:51:41 -0700
Quoted 7 lines
This started out with fixing a sparse warning, then I realized that the wrapper function
br_netpoll_infocould just be collapsed away by rolling it into the enable code.Also, eliminate unnecessary goto's
Signed-off-by Stephen Hemminger <[email protected]>
Applied.